Page 1 of 1

Setting session.name using ini_set

Posted: Sat Jan 07, 2006 12:26 am
by anjanesh
All this time I was using the default PHPSESSID.
Still unclear with sessions.

Code: Select all

localhost
 |
 |
 ---webiste1
 |
 |
 ---webiste2
In localhost/website1 I've set - ini_set("session.name" , "website1");
In localhost/website2 I've set - ini_set("session.name" , "website2");

When both are opened (in different tabs/windows)
session_name() should return website1 for website1 and website2 for website2 right ? Theres a session_name for each website - or setting it using ini_set sets it for entire localhost ?

Posted: Sat Jan 07, 2006 1:59 am
by feyd
Why not test it, instead of asking?

Posted: Sat Jan 07, 2006 2:15 am
by Jenk
ini_set only changes ini settings for the remainder of the request that it is called in.

Posted: Sat Jan 07, 2006 2:44 am
by anjanesh
feyd wrote:Why not test it, instead of asking?
Because Im getting wierd results.
Im setting session.name to website1 in website1 and website2 in website2, but when both are opened, session.name is set to the last set value - irrespective of the folder (website1 or website2)
Actually I had installed PHP 5.1.1 - and deleted PHP 5.0.3 - so I overwrote all the settings....I guess something went wrong in that part.

Posted: Sat Jan 07, 2006 2:54 am
by Jenk