SunQuest
           Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old February 6th, 2001, 01:24 PM
s_ashok s_ashok is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: Chicago, IL
Posts: 14 s_ashok User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,
I am quite new in perl and need a help. Could someone give me some pointer as to how I can remove a cookie which has been set when a user logs out.

thanks

Reply With Quote
  #2  
Old February 6th, 2001, 01:38 PM
mickalo's Avatar
mickalo mickalo is offline
Ole` Timer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: N.W. Iowa
Posts: 469 mickalo User rank is Private First Class (20 - 50 Reputation Level)mickalo User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 5 h 19 sec
Reputation Power: 8
Send a message via AIM to mickalo Send a message via MSN to mickalo
What you need to do is set what's referred to as a "session cookie", which expires as soon as the person closes their browser. When the cookie is set, don't set any expiration date/time.

Mickalo
__________________

Thunder Rain Internet Publishing

Custom Programming & Database development
Providing Personal/Business
Internet Solutions that work!

Reply With Quote
  #3  
Old February 6th, 2001, 01:43 PM
s_ashok s_ashok is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: Chicago, IL
Posts: 14 s_ashok User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks, But I was thinking of using or rather testing by putting the value as "loggedout". Do you think this won't work. Okay, i attaching the code below
redirect_with_cookie
{
$authcookie = cookie(-name=>'ashAuth',
-value=>'loggedout',
-expires=>'-1m',
-path=>'/',
-domain=>'.ash.com',
-secure=>0);
$admincookie = cookie(-name=>'ashAdmin',
-value=>'loggedout',
-expires=>'-1m',
-path=>'/',
-domain=>'.ash.com',
-secure=>0);

print redirect(-cookie=>[$authcookie, $admincookie],
-location=>$firstpage);
Somehow this is not working. when as a user, I am signing off.

Reply With Quote
  #4  
Old February 6th, 2001, 02:48 PM
mickalo's Avatar
mickalo mickalo is offline
Ole` Timer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: N.W. Iowa
Posts: 469 mickalo User rank is Private First Class (20 - 50 Reputation Level)mickalo User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 5 h 19 sec
Reputation Power: 8
Send a message via AIM to mickalo Send a message via MSN to mickalo
The problem is, you need to set the cookie first, then do the redirect. Try this, and see if this works for you:
Code:
$authcookie = cookie(-name=>'ashAuth', 
-value=>'loggedout', 
-expires=>'-1m', 
-path=>'/', 
-domain=>'.ash.com', 
-secure=>0); 
$admincookie = cookie(-name=>'ashAdmin', 
-value=>'loggedout', 
-expires=>'-1m', 
-path=>'/', 
-domain=>'.ash.com', 
-secure=>0);
# Set the cookies 
print header(-cookie=>[$authcookie,$admincookie]);
# Call redirect
print redirect(-location=>'$firstpage');


Cheers,

Mickalo

Reply With Quote
  #5  
Old February 6th, 2001, 02:59 PM
s_ashok s_ashok is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: Chicago, IL
Posts: 14 s_ashok User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks for the above modified code. It is working now.
regards
ashok

Reply With Quote
Closed Thread

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > cookie removal


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway