Re: @session_start generates a new session_id
| From: | Mark-Walter at t-online dot de | Date: | Tue, 19 Oct 2004 16:21:29 +0000 |
| Subject: | Re: @session_start generates a new session_id | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-199811@lists.php.net to get a copy of this message | ||
Hi Matt,
> > @session_start();
> > session_name("userauth");
> > $_SESSION['SESS_CUS'] = $user_id;
> I am not 100% sure what the problem is, but if you are trying to
> change the session name to userauth, I think you need to do that
> before session_start
session_name() works ok so far.
For example:
<?
@session_start;
$session = session_id(); /* index.php */
$_SESSION['SESS_CUS'] == $user_id;
echo $session;
?>
OUTPUT in the browser:
34f321149ee49d20e0e223f3020c1f77
In the case a new page is loaded it changes to a new value:
<?
$session = session_id(); /* userauth.php */
echo "PHPSESSID: $session";
echo "SESSION:".$_SESSION['SESS_CUS'];
?>
OUTPUT in the browser:
PHPSESSID: b65de73df8d327a4e15627ccfd14968d
SESSION:
A new request over http generates a new session and
$_SESSION['XYZ'] is not available anymore.
--
Best Regards,
Mark