Gossamer Forum
Home : General : Perl Programming :

Cookies and Domains

Quote Reply
Cookies and Domains
Hi

I've got the following code to set a cookie:

Code:
my $cookie_sesh_id = $query->cookie (
-name => 'sesh_id',
-value => $rand_id,
-expires => '+2M',
-path => '/',
-host => '.wyb2003.co.uk'
);

However, I want to know how to match both these domains:

Code:
wyb2003.co.uk
www.wyb2003.co.uk

Currently, I have .wyb2003.co.uk which matches anyprefix.wyb2003.co.uk but not wyb2003.co.uk on it's own.

Thanks

- wil
Quote Reply
Re: [Wil] Cookies and Domains In reply to
I remember reading somewhere that you can use commas to seperate the domains. That is most likely not true...as it wasn't one of the most accurate sites I have used....but its worth a try Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Wil] Cookies and Domains In reply to
I've been struggling with this as well:

http://www.gossamer-threads.com/...i?post=222094#222094

Your version should work on many browsers (IE 6 and Mozilla, by my testing), but not in some others (notably NS 4.7X). I spent a lot of time on this problem and ultimately came to the conclusion that no perfect cookie-based solution exists. If you read that post I linked to, you'll see that I've been trying to solve the problem with mod_rewrite, but I still haven't completely gotten it working.

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Quote Reply
Re: [hennagaijin] Cookies and Domains In reply to
What others have suggested to me is that I set two cookies, one for wyb2003.co.uk and one for www.wyb2003.co.uk. Clumsy, but it works.

- wil
Quote Reply
Re: [Andy] Cookies and Domains In reply to
Hi Andy

I don't believe you can, or at least not in my version of Perl and CGI.pm (Perl 5.6).

Cheers

- wil