[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Expire page


> I am making an application using CGI::App and H::T. The problem is
> that if a user logs out, then presses the Back browser button, he
> sees the page before the logout. In this case, I am just executing
> the homepage run mode without anything special. The question is what
> can I do to prevent this? Is there any special mechanism used to do
> this? This is my first "serious" web application and I don't know how
> to prevent this to happen.

This is quite common, and there's usually no reason to preven this, as long as you're implementing the session management mechanism properly. It happens because your browser caches the pages and by pressing "Back" button your browser displays the cached copy.

You can tell the browser NOT to cache the pages by setting an expiration value of the page to some negative value:

print $cgi->header(-expire=>"-1s");

This prevents the pages from getting cached. But try not to do this in every single page, since it tends to annoy people. Do it wherever necessary.

Sherzod





_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.