Re: two php scripts with same $_SESSION variables

From: Date: Thu, 24 May 2007 14:00:03 +0000
Subject: Re: two php scripts with same $_SESSION variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-255530@lists.php.net to get a copy of this message
Jean-Christophe Roux wrote:
Stut wrote What you're wanting to do can be achieved by setting the path on the session cookies. You may be able to do this by calling ini_set to change session.cookie_path before calling session_start. ini_set('session.cookie_path', '/A/'); session_start(); That's a good solution; it works fine. Thank you Mike wrote To get this, just call session_name() with the appropriate value immediately before every session_start(). session_name('SESSID_A'); session_start(); That's a good solution; it works fine. Thank you Are those two solutions equivalent or are there circumstances where one would be better than the other?
Changing the session name is better, and I'm kicking myself for not thinking of it. It's more portable because you won't have to change the code if you move it to another location. -Stut

« previous php.general (#255530) next »