Friday, June 29, 2007

PHP: Sessions

Sessions are not hard to understand either..

session is created per user/per site that use sessions.

Sessions:
- create session id and save it as a cookie PHPSESSID
- needs to be called at the very very top of the file by calling session_start();
session_start() will look for existing sessions and create new if there was none.
- sessions values can be added by storing into $_SESSION['key'] associative array.

and you can use it however you want it.

No comments: