Please see this code. This is how, i am setting my cookie. I am using Frameset.
Expand|Select|Wrap|Line Numbers
- $kid = time;
- $cookie = cookie(-name=>'logtime',
- -value=>$kid,
- -expires=>'+2m',
- -path=>'/cgi-bin/');
- print header(-cookie=>$cookie);
Log out frameset link on left
Expand|Select|Wrap|Line Numbers
- print "<a href=/cgi-bin/auth/ssesschk.cgi?sid=0&rollno=$prollno target=\"_top\" >Logout</a>";
ssesschk.cgi -->logout page
my ssesschk.cgi coding
Expand|Select|Wrap|Line Numbers
- #!c:/perl/bin/perl
- use CGI qw(:all);
- $psid=param('sid');
- $prollno=param('rollno');
- if ($psid == 0)
- {
- use DBI; my $dbh = DBI->connect("DBI:ODBC:xxxxx","dsn","pass") or die "Can not connect: $DBI::errstr\n";
- $sth = $dbh->prepare("update tbname set kid = ? where rollno = ?") or die "Can not prepare SQL statement: $DBI::errstr\n";
- $sth->execute(0,$pdeptcode) or die "Can not execute SQL statement: $DBI::errstr\n";
- print <<EOF;
- Content-Type: text/html
- <html><head><title>Login</title> <script>top.window.location.href="/index.html";</script> </html>
- EOF
- }
When i click log out, i moves to index.html page. When the user clicks back button of the browser, they are continuing in doing their jobs. I want to stop this.
How i can check the cookie value and then how i can reset my cookie value. what is the use of in resetting the cookie value. Thanks in advance