Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-17-2005, 12:29 PM   #1
Registered: Sep 2005
Posts: 121

Rep: Reputation: 16
Help Needed - Logging Users Out and Clearing cache or disabling back/forward buttons

Hi there, I am using Perl/CGI scripting and I am trying to set up my web site so that it automatically logs people out after a pre-determined time and they will not be able to use the "go back/forward" buttons to see the full contents of the screen that they were last viewing before being logged out.

You know how if you are logged into online banking and you get automatcally logged out and you cannot go back to where you were without logging back in? Thats what I am trying to accomplish.

I do have ExpiresActive turned on and set in my Apache configuration, but that does not seem to help.

As per below, I also have the META HTTP Equiv set but that does not help either as users can still use the back buttons on their browsers to go back and see the original page and its contents. The user gets a message saying that the cache has expired but the problem is that they can still see the contents of everything as though they were actually still logged in.

Any help or ideas would be appreciated even if its in another language that can be integrated with Perl/CGI

#!/usr/bin/perl -w
#Created By Anthony Saulnier

use CGI;
use Digest::MD5 qw( md5_base64 );
$q = new CGI;
$expirytime=gmtime(time()+01*01*60)." GMT";
#basically sets the $expiry time to 60 second, but you have to put the hour and day for some reason
$username = $q->param('username');
$password = $q->param('hidden');
$submit = $q->param('submit');
$path = "/";

#$usernamecookie = $q->cookie(-name=>'$username',
# -value=>$username,
# -expires=>$expirytime,
# -domian=>$domain,
# -path=>'/');

print $q->header;

#print $q->header(-cookie=>$usernamecookie);

print qq~<META HTTP-EQUIV="Cache-Control" CONTENT="NO-CACHE">~;
print qq~<META HTTP-EQUIV="expires" CONTENT="0">~;


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
side mouse buttons - forward and back? Moebius Linux - Software 3 08-07-2004 12:14 PM
MS Intellimouse back/forward buttons Cheechi Linux - Hardware 5 07-23-2004 01:44 PM
No back/forward buttons or scrollbar in firefox Lul2x Linux - Software 7 03-28-2004 06:41 PM
Back and Forward buttons opafire Slackware 12 02-11-2004 10:04 PM
Mozilla - back/forward buttons don't work jatcan Linux - Software 1 09-13-2003 09:17 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration