| 
	
 | 
 Posted by Jerry Stuckle on 10/31/06 12:22 
Koncept wrote: 
> In article <1162207549.606471.131080@i42g2000cwa.googlegroups.com>, 
> <crescent_au@yahoo.com> wrote: 
>  
>  
>>Hi all, 
>> 
>>I've written a login/logout code. It does what it's supposed to do but 
>>the problem is when I logout and press browser's back button (in 
>>Firefox), I get to the last login page. In IE, when I press back 
>>button, I get to the page that says "Page has Expired" but Firefox does 
>>not do this. 
>> 
>>I think it's something to do with sessions not properly unset or 
>>something like that but I haven't been able to figure it out. I am 
>>attaching my codes and database structure below. If you need more info, 
>>please email me. I really want this to be fixed asap. I've played with 
>>this long enough. Thanks! 
>> 
>  
>  
> Just curious what happens if you add these headers to the previous 
> pages? 
>  
> ( code from docs ) 
>  
> <?php 
> header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 
> header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past 
> ?> 
>  
> And this for the destruction of the session: 
>  
> <?php 
> $_SESSION = array(); 
>  
> // Note: This will destroy the session, and not just the session data! 
> if ( isset( $_COOKIE[session_name()] ) ) 
>    setcookie( session_name(), '', time() - 42000, '/' ); 
> 
 
This line will never do anything.  The session_name is the value of the  
cookie, not the name.  The cookie name is set in the php.ini file  
(default: PHPSESSID). 
 
> // Finally, destroy the session. 
> session_destroy(); 
> ?> 
>  
 
 
--  
================== 
Remove the "x" from my email address 
Jerry Stuckle 
JDS Computer Training Corp. 
jstucklex@attglobal.net 
==================
 
[Back to original message] 
 |