Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am using Javascript to set a Cookie and trying to read the cookie back using a Perl script on another page. The reason that I'm using JS is that I wish to allow a user to dynamically add things to a cookie on different pages for a shopping basket and then allow the user to download all the items off a single page.
I am setting the cookie in JS using the document.cookie method as follows:
where the cookie name is cookie and attempting to read the cookie using CGI.pm:var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); document.cookie = curCookie;
but it is reporting that no cookie is set. The cookie set and read scripts are in the same domain and from my reading of cookie standards, there should be no compatibility issues between Perl and JS.my $cookie_in = $query->cookie("cookie");
I'd appreciate any help,
Regards,
Kakaze
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl reading Cookies Set by Javascript
by broquaint (Abbot) on Jul 25, 2002 at 11:43 UTC | |
by kakaze (Sexton) on Jul 25, 2002 at 12:16 UTC | |
by io (Scribe) on Jul 25, 2002 at 12:23 UTC | |
by kakaze (Sexton) on Jul 25, 2002 at 12:28 UTC | |
|
Re: Perl reading Cookies Set by Javascript
by io (Scribe) on Jul 25, 2002 at 11:38 UTC | |
|
Re: Perl reading Cookies Set by Javascript
by dws (Chancellor) on Jul 25, 2002 at 16:41 UTC |