Bug #13808: Session vars not saved

From: Date: Wed, 24 Oct 2001 08:35:53 +0000
Subject: Bug #13808: Session vars not saved
Groups: php.dev 
Request: Send a blank email to php-dev+get-68919@lists.php.net to get a copy of this message
From: fabien.dehopre@itn.skynet.be Operating system: Windows 2000 Pro PHP version: 4.0.6 PHP Bug Type: Session related Bug description: Session vars not saved I use a class to manage member on my site (login, logout, register, ...). When a user login, I want to save a unique id to identify the user. But the token is never save in the session. When I use a cookie to remember user, the session works. The token is set in a class function and just after, I redirect the user with a header("Location: $HTTP_REFERER"); There is the script I use for login user: session_start(); ... $res = $user->login("$nickname","$passwd",$rem); if ($res) { header("Location: index.php?module=home&content=default"."&".session_name()."=".session_id()); exit; } The class function login: function login($username,$passwd,$remember=false) { ... if ($remember) setcookie("token_cook",$token,time()+(365*24*60*60)); session_register('token_sess'); $token_sess = $token_cook = $token; $this->errno = 0; return true; } I would like to know what is wrong in my script. Thanks. Fab -- Edit bug report at: http://bugs.php.net/?id=13808&edit=1

« previous php.dev (#68919) next »