Re: [PHP-DB] killing cookie
I'm using $_SESSION['username'] to set the cookie. If I cookie exsist I am automatically logged in by means of if (isset($_COOKIE['user']) | ($_COOKIE['pass'])) { $_SESSION['username'] = $_COOKIE['user']; $_SESSION['password'] = $_COOKIE['pass']; $logged_in = 1; setcookie('user',$_SESSION['username'],time()+36000); setcookie('pass',$_SESSION['password'],time()+36000); when I delete my cookie it looks like this: (this is my logout function) setcookie('user',$_SESSION['username'],time()-60); setcookie('pass',$_SESSION['password'],time()-60);//kill cookie unset($_SESSION['username']); unset($_SESSION['password']); // kill session variables $_SESSION = array(); // reset session array session_destroy(); // destroy session. I know I still have the cookie because... it's still in my temp folder AND I'm still logged in. Jacco -- http://seabird.jmtech.ca Attitude is Everything! But Remember, Attitudes are Contagious! Is Yours worth Catching "Peter Beckman" <[EMAIL PROTECTED]> wrote in message news:20021101132453.N64513-10@;thermonuclear.org... > You are doing it wrong then. Are you checking $_SESSION['username'] or > $_COOKIE['user'] to determine if the cookie is being deleted? Or looking > in your cookies.txt (or similar) file/directory to see if they still exist? > > What exactly is your PROOF :-) that the cookie is not deleted? > > Peter > > On Fri, 1 Nov 2002, Seabird wrote: > > > Nope, doesn't work. > > > > In PHP manual the say that the correct way is to set the cookie in a already > > expired time. That's why I used time()-60 but it doesn't work... > > > > Anybody else? > > Jacco > > -- > > http://seabird.jmtech.ca > > > > Attitude is Everything! > > But Remember, Attitudes are Contagious! > > Is Yours worth Catching > > "Josh Johnson" <[EMAIL PROTECTED]> wrote in message > > news:004101c281d3$55b80100$8b00a8c0@;manpa... > > > I'm pretty sure you just have to set a cookie to an empty string to > > > delete it, i.e., no expiration time > > > > > > -- Josh > > > > > > -Original Message- > > > From: Seabird [mailto:jacco@;vliegt.nl] > > > Sent: Friday, November 01, 2002 7:16 AM > > > To: [EMAIL PROTECTED] > > > Subject: [PHP-DB] killing cookie > > > > > > Hi everyone, > > > > > > I don't understand why my cookie won't be removed. > > > > > > I set my cookie: > > > > > > setcookie('user',$_SESSION['username'],time()+36000); > > > setcookie('pass',$_SESSION['password'],time()+36000); > > > > > > I kill my cookie: > > > > > > setcookie('user','',time()-60); > > > setcookie('pass','',time()-60); > > > > > > but it doesn't work. why not?? > > > Jacco > > > > > > -- > > > http://seabird.jmtech.ca > > > > > > Attitude is Everything! > > > But Remember, Attitudes are Contagious! > > > Is Yours worth Catching > > > > > > > > > > > > -- > > > PHP Database Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- - > Peter BeckmanSystems Engineer, Fairfax Cable Access Corporation > [EMAIL PROTECTED] http://www.purplecow.com/ > -- - > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] killing cookie
try setcookie('user'); setcookie with no parameters other than name deletes the cookie. Lee "Seabird" cc: Subject: Re: [PHP-DB] killing cookie 11/01/2002 07:23 AM Nope, doesn't work. In PHP manual the say that the correct way is to set the cookie in a already expired time. That's why I used time()-60 but it doesn't work... Anybody else? Jacco -- http://seabird.jmtech.ca Attitude is Everything! But Remember, Attitudes are Contagious! Is Yours worth Catching "Josh Johnson" <[EMAIL PROTECTED]> wrote in message news:004101c281d3$55b80100$8b00a8c0@;manpa... > I'm pretty sure you just have to set a cookie to an empty string to > delete it, i.e., no expiration time > > -- Josh > > -Original Message- > From: Seabird [mailto:jacco@;vliegt.nl] > Sent: Friday, November 01, 2002 7:16 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] killing cookie > > Hi everyone, > > I don't understand why my cookie won't be removed. > > I set my cookie: > > setcookie('user',$_SESSION['username'],time()+36000); > setcookie('pass',$_SESSION['password'],time()+36000); > > I kill my cookie: > > setcookie('user','',time()-60); > setcookie('pass','',time()-60); > > but it doesn't work. why not?? > Jacco > > -- > http://seabird.jmtech.ca > > Attitude is Everything! > But Remember, Attitudes are Contagious! > Is Yours worth Catching > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] killing cookie
further down in the manual it says. -> Cookies must be deleted with the same parameters as they were set with. http://www.php.net/manual/en/function.setcookie.php "Seabird" cc: Subject: Re: [PHP-DB] killing cookie 11/01/2002 07:23 AM Nope, doesn't work. In PHP manual the say that the correct way is to set the cookie in a already expired time. That's why I used time()-60 but it doesn't work... Anybody else? Jacco -- http://seabird.jmtech.ca Attitude is Everything! But Remember, Attitudes are Contagious! Is Yours worth Catching "Josh Johnson" <[EMAIL PROTECTED]> wrote in message news:004101c281d3$55b80100$8b00a8c0@;manpa... > I'm pretty sure you just have to set a cookie to an empty string to > delete it, i.e., no expiration time > > -- Josh > > -Original Message- > From: Seabird [mailto:jacco@;vliegt.nl] > Sent: Friday, November 01, 2002 7:16 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] killing cookie > > Hi everyone, > > I don't understand why my cookie won't be removed. > > I set my cookie: > > setcookie('user',$_SESSION['username'],time()+36000); > setcookie('pass',$_SESSION['password'],time()+36000); > > I kill my cookie: > > setcookie('user','',time()-60); > setcookie('pass','',time()-60); > > but it doesn't work. why not?? > Jacco > > -- > http://seabird.jmtech.ca > > Attitude is Everything! > But Remember, Attitudes are Contagious! > Is Yours worth Catching > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] killing cookie
You are doing it wrong then. Are you checking $_SESSION['username'] or $_COOKIE['user'] to determine if the cookie is being deleted? Or looking in your cookies.txt (or similar) file/directory to see if they still exist? What exactly is your PROOF :-) that the cookie is not deleted? Peter On Fri, 1 Nov 2002, Seabird wrote: > Nope, doesn't work. > > In PHP manual the say that the correct way is to set the cookie in a already > expired time. That's why I used time()-60 but it doesn't work... > > Anybody else? > Jacco > -- > http://seabird.jmtech.ca > > Attitude is Everything! > But Remember, Attitudes are Contagious! > Is Yours worth Catching > "Josh Johnson" <[EMAIL PROTECTED]> wrote in message > news:004101c281d3$55b80100$8b00a8c0@;manpa... > > I'm pretty sure you just have to set a cookie to an empty string to > > delete it, i.e., no expiration time > > > > -- Josh > > > > -Original Message----- > > From: Seabird [mailto:jacco@;vliegt.nl] > > Sent: Friday, November 01, 2002 7:16 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP-DB] killing cookie > > > > Hi everyone, > > > > I don't understand why my cookie won't be removed. > > > > I set my cookie: > > > > setcookie('user',$_SESSION['username'],time()+36000); > > setcookie('pass',$_SESSION['password'],time()+36000); > > > > I kill my cookie: > > > > setcookie('user','',time()-60); > > setcookie('pass','',time()-60); > > > > but it doesn't work. why not?? > > Jacco > > > > -- > > http://seabird.jmtech.ca > > > > Attitude is Everything! > > But Remember, Attitudes are Contagious! > > Is Yours worth Catching > > > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > --- Peter BeckmanSystems Engineer, Fairfax Cable Access Corporation [EMAIL PROTECTED] http://www.purplecow.com/ --- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] killing cookie
Nope, doesn't work. In PHP manual the say that the correct way is to set the cookie in a already expired time. That's why I used time()-60 but it doesn't work... Anybody else? Jacco -- http://seabird.jmtech.ca Attitude is Everything! But Remember, Attitudes are Contagious! Is Yours worth Catching "Josh Johnson" <[EMAIL PROTECTED]> wrote in message news:004101c281d3$55b80100$8b00a8c0@;manpa... > I'm pretty sure you just have to set a cookie to an empty string to > delete it, i.e., no expiration time > > -- Josh > > -Original Message- > From: Seabird [mailto:jacco@;vliegt.nl] > Sent: Friday, November 01, 2002 7:16 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] killing cookie > > Hi everyone, > > I don't understand why my cookie won't be removed. > > I set my cookie: > > setcookie('user',$_SESSION['username'],time()+36000); > setcookie('pass',$_SESSION['password'],time()+36000); > > I kill my cookie: > > setcookie('user','',time()-60); > setcookie('pass','',time()-60); > > but it doesn't work. why not?? > Jacco > > -- > http://seabird.jmtech.ca > > Attitude is Everything! > But Remember, Attitudes are Contagious! > Is Yours worth Catching > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] killing cookie
I'm pretty sure you just have to set a cookie to an empty string to delete it, i.e., no expiration time -- Josh -Original Message- From: Seabird [mailto:jacco@;vliegt.nl] Sent: Friday, November 01, 2002 7:16 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] killing cookie Hi everyone, I don't understand why my cookie won't be removed. I set my cookie: setcookie('user',$_SESSION['username'],time()+36000); setcookie('pass',$_SESSION['password'],time()+36000); I kill my cookie: setcookie('user','',time()-60); setcookie('pass','',time()-60); but it doesn't work. why not?? Jacco -- http://seabird.jmtech.ca Attitude is Everything! But Remember, Attitudes are Contagious! Is Yours worth Catching -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] killing cookie
try setcookie('user',''); On Fri, 1 Nov 2002, Seabird wrote: > Hi everyone, > > I don't understand why my cookie won't be removed. > > I set my cookie: > > setcookie('user',$_SESSION['username'],time()+36000); > setcookie('pass',$_SESSION['password'],time()+36000); > > I kill my cookie: > > setcookie('user','',time()-60); > setcookie('pass','',time()-60); > > but it doesn't work. why not?? > Jacco > > -- > http://seabird.jmtech.ca > > Attitude is Everything! > But Remember, Attitudes are Contagious! > Is Yours worth Catching > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > --- Peter BeckmanSystems Engineer, Fairfax Cable Access Corporation [EMAIL PROTECTED] http://www.purplecow.com/ --- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] killing cookie
you need the exact same parameters as you used to set the cookie. http://www.php.net/manual/en/function.setcookie.php "Seabird" cc: Subject: [PHP-DB] killing cookie 11/01/2002 07:16 AM Hi everyone, I don't understand why my cookie won't be removed. I set my cookie: setcookie('user',$_SESSION['username'],time()+36000); setcookie('pass',$_SESSION['password'],time()+36000); I kill my cookie: setcookie('user','',time()-60); setcookie('pass','',time()-60); but it doesn't work. why not?? Jacco -- http://seabird.jmtech.ca Attitude is Everything! But Remember, Attitudes are Contagious! Is Yours worth Catching -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] killing cookie
Hi everyone, I don't understand why my cookie won't be removed. I set my cookie: setcookie('user',$_SESSION['username'],time()+36000); setcookie('pass',$_SESSION['password'],time()+36000); I kill my cookie: setcookie('user','',time()-60); setcookie('pass','',time()-60); but it doesn't work. why not?? Jacco -- http://seabird.jmtech.ca Attitude is Everything! But Remember, Attitudes are Contagious! Is Yours worth Catching -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php