Gossamer Forum
Quote Reply
Playing with cookies...
Hi..I'm just getting around to playing with Cookie in Links SQL Plugins. Now, please note I've never used cooies in Perl, let alone LSQL, so please give me some slack Wink

I've been reading through the documents, and have come up with;

Code:
# set the cookie up...
my $c = GT::CGI->cookie (-name => 'IDList', -value => $ID);

# save the cookie...
print $IN->header ( -cookie => $c );

Then, in another sub I'm calling the following to view the value of the cookie;


Code:
my $cookie = GT::CGI->cookie (-name => 'IDList');
print $cookie->{$_} foreach keys %{$cookie};

It doesn't seem to be saving the value of $ID though... Unsure

Can anyone see the stupid mistake I'm making?

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] Playing with cookies... In reply to
Set:

Code:
my $cookie = $IN->cookie( -name => 'IDList', -value => $ID, -path => '/', -expires => '+1h' );

print $IN->header( -cookie => $cookie );

Get:

Code:
my $value = $IN->cookie('IDList');
Quote Reply
Re: [Paul] Playing with cookies... In reply to
Ah, thats great. Now WHY didn't I start working with cookies before Tongue

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!