SPUG: CGI::Cookies question
David Waring
dwaring at nwsr.com
Wed Mar 1 22:03:03 CST 2000
I had a problem like this with IE last year. Seems to be a bug in IE.
Turns out if you set a cookie with no value, IE (at least v4 and v5
on NT) will not accept any other cookies from that domain. If I
remember correctly it behaved as if it was accepting the cookie but
it really didn't. Perhaps this is the problem.
David Waring
>Friends,
> I guess I'll take advantage of this slow period on the list to ask my
>stupid question. The problem I'm having is that I have a problem with IE
>accepting my cookies. My code is thus:
>
>----------------------------------------------------------------
>use CGI qw/:standard/;
>use CGI::Cookie;
>
>print SetStandardCookies($UserName, $Password);
>
>s*b SetStandardCookies
> {
> my ($UserName, $Password) = @_;
>
> my ($UserNameCookie, $PasswordCookie);
>
> $UserNameCookie = new CGI::Cookie(-name => 'UserName',
> -value => $UserName,
> -domain => 'cdarley.dyndns.org',
> -path => '/games/',
> -expires => "+1h");
>
> $PasswordCookie = new CGI::Cookie(-name => 'Password',
> -value => $Password,
> -domain => 'cdarley.dyndns.org',
> -path => '/games/',
> -expires => "+1h");
> return header(-cookie=>[$UserNameCookie, $PasswordCookie]);
> };
>----------------------------------------------------------------
>
> It sets the cookie on Netscape, and used to set the cookie on
>IE browsers
>when my application was being served from a Win98 machine, but now that I've
>ported it to Apache mod_perl under Linux, IE doesn't end up with any
>cookies. Anybody have any experience with this kind of thig, or is there
>some obvouse error in my code?
>
> Thanks for your help!
>
>Peter Darley
>
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
> Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
> SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
> Email to majordomo at pm.org: ACTION spug-list your_address
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
Email to majordomo at pm.org: ACTION spug-list your_address
More information about the spug-list
mailing list