Re: HELP COOKIES !

From: Date: Tue, 05 Nov 2002 07:18:55 +0000
Subject: Re: HELP COOKIES !
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-122736@lists.php.net to get a copy of this message
"Erwin" <erwin@isiz.com> wrote in message news:20021104153413.19848.qmail@pb1.pair.com... > Shaun wrote: > > Hi, > > > > I tried some advice you gave , i tried to destroy the session cookie > > wiht setcookie(session_name()); and setcookie(session_name(),-3600); > > but the cookie is still there . Instead , there are now 2 cookies > > with the same name , the one has the session id , the other has no > > contents! HOW CAN I DELETE THESE THINGS !!! > > Heh...LOL > My mistake...at first you destroy the session, then you are using > session_name(). The session_name() function will then (of course) return an > empty string. Try setting the cookie (with -3600) before session_destroy(). > > First question: why are you using a cookie??? If you use session_start(), a > cookie is automaticaly send to the client. > > Grtz Erwin > 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 ? Thanks alot Shaun

« previous php.general (#122736) next »