⭐ in reply to Why can't I access a cookie I have set?
Cookies are accessed through $q->cookie('name').my $q = new CGI;
Cookies are sent by the browser when requesting the page. If you set a cookie in a CGI script, the cookie is sent to the browser, but not set in $q->cookie. ie,
Set == Cookie stored in browser Readable == Cookie available in $q->cookie('name') Event Set? Readable? Browser request n n Response to Browser y n Subsequent Browser y y Requests(*)
(*) - within the life of the cookie.
Just remember that $q->cookie only contains cookies sent by the browser as part of that particular http request!
Hope that clears things up a little :)
cLive ;-)
|
|---|