Re: HELP COOKIES !

From: Date: Tue, 05 Nov 2002 10:37:36 +0000
Subject: Re: HELP COOKIES !
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-122745@lists.php.net to get a copy of this message
"Erwin" <erwin@isiz.com> wrote in message news:20021105082624.74531.qmail@pb1.pair.com... > > Hi Grtz Erwin, > > > > let me tell you wat i need to do. > > > > 1.) I have a login page - if the user logs in correctly i create > > session(with session_start()) , a cookie is written to client + > > session file to server. > > 2.)When the user logs off - i call the logOff.php page . The contents > > are as follows : > > > > <?php > > session_start(); > > setcookie(session_name(),-3600); > > session_unset(); > > session_destroy(); > > ect. > > ?> > > > > Now , when the user logs in again , i want a NEW COOKIE to be sent > > with a new id , to the client! This does not happen as the first > > cookie was never deleted. > > So when the user logs in again the same cookie is used ! why ? > > That's weird indeed. OK, try this instead: > > <? > $name = session_name(); > session_unset(); > session_destroy(); > setcookie( $name, '', '', '/' ); > ?> > > Regards > Erwin hi , Still not working ! After i run the commands above i do the [ print phpinfo(); ] statement , when i go down to php variable and look at cookies , there are now two identical named cookies eg. PHPSESSID = 2%C something and PHPSESSID = 234313414837418374813748dfaj (long id number) Instead of deleting the damn cookie , i create a new one it seems ! wat is there to do ? Thanks Shaun

« previous php.general (#122745) next »