|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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! |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
||||
|
||||
|
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 |
|
#5
|
|||
|
|||
|
thanks for the above modified code. It is working now.
regards ashok |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > cookie removal |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|