htmanning has asked for the wisdom of the Perl Monks concerning the following question:
Then I read it like this:sub write_cookies { print "Set-Cookie: reguser=$username; expires=$expires; path=/;\n" +; print "Set-Cookie: regpass=$password; expires=$expires; path=/;\n" +; print "Set-Cookie: regtype=$regtype; expires=$expires; path=/;\n"; }
I need to instead set 1 cookie, and then separate the values when I read it back in. Any help would be appreciated. Thanks.local(@getcookies) = split (/; /,$ENV{'HTTP_COOKIE'}); local(%cookies); foreach(@getcookies){ ($ckey, $cval) = split (/=/,$_); $cookies{$ckey} = $cval; } $username = $cookies{'reguser'}; $password = $cookies{'regpass'}; $regtype = $cookies{'regtype'}; $login = "Login" if ($username && $password && !$logout);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Setting single cookie with a separator
by Anonymous Monk on Aug 25, 2011 at 02:33 UTC | |
by htmanning (Friar) on Aug 25, 2011 at 04:38 UTC | |
by Anonymous Monk on Aug 25, 2011 at 08:27 UTC | |
|
Re: Setting single cookie with a separator
by scorpio17 (Canon) on Aug 25, 2011 at 13:05 UTC | |
by Anonymous Monk on Aug 26, 2011 at 06:09 UTC |