can any tell me how to use cookies in perl[cool]
Feb 20, 2003, 1:43 AM
Veteran / Moderator (18441 posts)
Feb 20, 2003, 1:43 AM
Post #2 of 6
Views: 7416
Basically to set a cookie;
# save the cookie...
print $IN->header( -cookie => $cookie );
And to read, something like;
Thats pretty much the simplest terms to put it in
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!
Code:
my $cookie = $IN->cookie( -name => 'CookieName', -value => "whatever value of variable here", -path => '/', -expires => '+1y' ); # save the cookie...
print $IN->header( -cookie => $cookie );
And to read, something like;
Code:
my $cut_up = $IN->cookie('CookieName');Thats pretty much the simplest terms to put it in
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!
Feb 20, 2003, 2:25 AM
Veteran / Moderator (4108 posts)
Feb 20, 2003, 2:25 AM
Post #4 of 6
Views: 7437
Feb 20, 2003, 2:29 AM
Veteran (19537 posts)
Feb 20, 2003, 2:29 AM
Post #5 of 6
Views: 7389
See the CGI.pm docs for complete documentation.
http://stein.cshl.org/...oftware/CGI/#cookies
or simpler:
http://www.cs.unc.edu/...omp117_6/tsld017.htm
http://stein.cshl.org/...oftware/CGI/#cookies
or simpler:
http://www.cs.unc.edu/...omp117_6/tsld017.htm
Feb 20, 2003, 2:30 AM
Veteran / Moderator (18441 posts)
Feb 20, 2003, 2:30 AM
Post #6 of 6
Views: 7409
Whoops....good point.
To define $IN, use something like;
$IN = new CGI;
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!
To define $IN, use something like;
Code:
use CGI; $IN = new CGI;
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!