Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHPSESSID vs session_id()

Status
Not open for further replies.

Sleidia

Technical User
May 4, 2001
1,284
FR
Hello,

I'just found out that:

when together,
session_start();
$user_ID = $PHPSESSID;
--> user_ID will be empty

when together,
session_start();
$user_ID = session_id();
--> user_ID will have a value

You have to use session_id() when you want to start the session and call the id in the same page.
* applied for Apache/php win32

 
Yes, if you configure PHP to disable register_globals, php does not copie the cookie var PHPSESSID to $PHPSESSID.

this way you can always do $_COOKIE["PHPSESSID"] instead of $PHPSESSID.

Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top