473,491 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to reset the cookie to an invalid value ?

147 New Member
Hi,

Please see this code. This is how, i am setting my cookie. I am using Frameset.




Expand|Select|Wrap|Line Numbers
  1. $kid = time;
  2.       $cookie = cookie(-name=>'logtime',
  3.       -value=>$kid,
  4.       -expires=>'+2m',
  5.       -path=>'/cgi-bin/');
  6.  
  7.        print header(-cookie=>$cookie);
  8.  

Log out frameset link on left
Expand|Select|Wrap|Line Numbers
  1. print "<a href=/cgi-bin/auth/ssesschk.cgi?sid=0&rollno=$prollno target=\"_top\" >Logout</a>";
  2.  

ssesschk.cgi -->logout page



my ssesschk.cgi coding


Expand|Select|Wrap|Line Numbers
  1. #!c:/perl/bin/perl 
  2. use CGI qw(:all);
  3. $psid=param('sid');
  4. $prollno=param('rollno');
  5. if ($psid == 0) 
  6. use DBI; my $dbh = DBI->connect("DBI:ODBC:xxxxx","dsn","pass") or die "Can not connect: $DBI::errstr\n";
  7. $sth = $dbh->prepare("update tbname set kid = ? where rollno = ?") or die "Can not prepare SQL statement: $DBI::errstr\n"; 
  8. $sth->execute(0,$pdeptcode) or die "Can not execute SQL statement: $DBI::errstr\n"; 
  9. print <<EOF; 
  10. Content-Type: text/html 
  11. <html><head><title>Login</title> <script>top.window.location.href="/index.html";</script> </html> 
  12. EOF
  13. }
  14.  
  15.  
  16.  




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
Feb 18 '11 #1
1 2352
numberwhun
3,509 Recognized Expert Moderator Specialist
First, you should check out the CGI::Session tutorial on CPAN.

Second, you won't be able to stop the user from using the back button in the browser. Its a futile thing to try to do if you ask me.

Regards,

Jeff
Feb 18 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

15
3187
by: lawrence | last post by:
Sorry for the dumb question but I'm new to Javascript. I wrote this script hoping to animate some div blocks on a page. You can see the page here: http://www.keymedia.biz/demo.htm Can anyone...
1
3231
by: Mike | last post by:
I got the code below from an earlier post but I can't get it to work (I get an error on the "for (i=0; i<a.length; i++)" line) Anyone have code that works for cookies with keys? > Anyone...
7
5619
by: Hamburgpear | last post by:
Dear All, Is it possible to reset the value of xxx.peek() after it reachs EOF ? Regards HP
1
2544
by: Gellert, Andre | last post by:
Hello, i have a bug in a php application based on postgres 7.2.2 , which cannot handle oid's greater than 2147483647 . So I have to reset the used oids to start from 1 again, so that we have more...
0
1227
by: Soeren S. Joergensen | last post by:
Hi, When entering an invalid value in a PropertyGrid, say entering 'A' where a numeric value is expected, a window pops up with an error. Is it possible to replace this window, or at least...
1
3632
by: Mad Scientist Jr | last post by:
I don't know how this is happening, but a dropdown control I have is resetting to the 2nd value on the list anytime a postback occurs. I have no initiation code outside of If Not (IsPostBack) ...
3
3973
by: Justin Morris via DotNetMonster.com | last post by:
<asp:TextBox ID="TextBox1" runat="server" value='<%=Server.HtmlEncode (Request.Cookies("Username")("Username"))%>'/> <input name="Password" type="text" id="Password" value='<%...
0
2166
by: Aamir79 | last post by:
I am using basic forms authentication in my web application and it is working fine on my Dev machine. However when I stress test the application using Microsoft ACT, And increase the number of...
4
4214
by: toufik | last post by:
Hi, In the ValueChanged event of a dateTimePicker control I've a condition, and I like to reset the initial value if teh condition is false Private Sub dateDebut_ValueChanged(ByVal sender As...
1
2175
by: rand201 | last post by:
I need to change the value for a autoincrement value to start value of 10000 not 0. The column already exists.
0
6980
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7364
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5452
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3087
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1397
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
282
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.