You are here: Re: need help with logout (logout not perfect) « PHP Programming Language « IT news, forums, messages
Re: need help with logout (logout not perfect)

Posted by Koncept on 10/30/06 13:53

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, '/' );

// Finally, destroy the session.
session_destroy();
?>

--
Koncept <<
"The snake that cannot shed its skin perishes. So do the spirits who are
prevented from changing their opinions; they cease to be a spirit." -Nietzsche

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация