Monks,
I'm currently setting 3 cookies for a site login. It works fine, but not on a BlackBerry Browser. There's a bug where the BB wants 1 cookie only. So, I need to set a single cookie and separate the values, then read it back in. Currently I'm setting them 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";
}
Then I read it like this:
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);
I need to instead set 1 cookie, and then separate the values when I read it back in. Any help would be appreciated.
Thanks.