September 2001
Intermediate to advanced
768 pages
32h 45m
English
string session_id(string session_ID) Gets or sets session ID.
Returns:
Session ID; FALSE on error
Description:
Gets or sets the session ID. If you’re not using your own session handlers, it’s a good idea to let PHP take care of it for you. You can also retrieve the session ID using the SID constant. This can be used to append the session ID to URLs, although this can be automated by compiling PHP with transparent session support. Transparent session support has a performance hit, however, so should be used with care.
Version:
Existing since version 4.0
Example:
session_start();
if (!$counter) {
session_register("counter");
}
echo session_id();
|
Read now
Unlock full access