Gossamer Forum
Home : General : Perl Programming :

Remove cookies completly?

Quote Reply
Remove cookies completly?
I've been trying to figure out how to clear a cookie from a PC's memory. Currently I'm trying the following code;

Code:
my $cookie_pass = $IN->cookie (-name => 'pass', -value => '', -path => '/' );
my $cookie_user = $IN->cookie (-name => 'user', -value => '', -path => '/' );

# finalise the cookies...
print $IN->header( -cookie => [$cookie_pass, $cookie_user] );

It doesn't seem to be working though. Is there a feature built into CGI::cookie that will let you delete cookies? I've searched high and low on google.com, but all the results seem to only tell you how to write cookies, and not clear them Unimpressed

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Remove cookies completly? In reply to
Set the expiry for -1y
Quote Reply
Re: [Paul] Remove cookies completly? In reply to
Minus 1 year? (just making sure)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Remove cookies completly? In reply to
Mmm....interesting. I've made it so that its set to expire in -1y , but now when I try to reset the cookies, with;

Code:
my $cookie_pass = $IN->cookie (-name => 'pass', -value => $Password, -path => '/', -expires => '+1h' );
my $cookie_user = $IN->cookie (-name => 'user', -value => $ID, -path => '/', -expires => '+1h' );

# finalise the cookies...
print $IN->header( -cookie => [$cookie_pass, $cookie_user] );

It doesn't like setting them. No fatal errors; it just doesn't write them, and they are therefore not available in the other sub routines Unimpressed

Any ideas?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Remove cookies completly? In reply to
Dunno what to say. Works for me.