PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   Bug Tracker (http://www.phpdig.net/forum/forumdisplay.php?f=27)
-   -   Logout does not clear cookies (http://www.phpdig.net/forum/showthread.php?t=1069)

manfred 07-12-2004 02:16 PM

Logout does not clear cookies
 
I can't log out with this new cookie based authoring system. When logout is clicked it just refresh the index.page and that's all.

Session based works OK.

WinXP, Apache 2.0.50, PHP5.0RC2 in use

M

Charter 07-12-2004 02:25 PM

Hi. Maybe a cache issue... what if you refresh?

manfred 07-12-2004 02:32 PM

Done that but still at admin page. Is there any special settings in php.ini or apache config file for cookies?

Or this can be a bug in PHP5RC2

M

Charter 07-12-2004 02:35 PM

Don't know if it's related to PHP5RC2 or not?

Try sticking all this at the top of admin/index.php and see if it takes:
PHP Code:

// prevent caching code from php.net
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0"false); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0 


manfred 07-12-2004 02:43 PM

Didn't help, also tried with PHP5RC1. I will study this further tomorrow with latest PHP version. Strange that I'm the only one having this problem.

M

Charter 07-12-2004 02:52 PM

In logout.php change:
PHP Code:

setcookie("phpdigadmin"""time()-3600); 

to the following:
PHP Code:

setcookie("phpdigadmin"""time()-3600"/"); 

Did it help?

manfred 07-12-2004 02:58 PM

Thanks, now it works. Also in php.net they think this is better way to clear cookies.



PHP Code:

setcookie("phpdigadmin"""mktime(12,0,0,111970), "/"); 

M


All times are GMT -8. The time now is 03:43 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.