Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Recommended modules for handling cookies?

by Anonymous Monk
on Mar 29, 2000 at 03:04 UTC ( #6387=note: print w/ replies, xml ) Need Help??


in reply to Recommended modules for handling cookies?

OK,

  1. Sorry for screwing up with the - which should have been _. That's what my code has.
  2. The cookie does get set, with a later expiration date than today.
  3. The cookie is in my netscape cookies file.
  4. Here's that snippet of code:
$cookie = $ENV{HTTP_COOKIE}; $name="cookie_name"; $value="cookie_value"; $cur_date = "Tue 28 Mar 2000 13:49:23 -0500"; $expires_date="Wed, 29 Mar 2000 13:49:23 -0500"; $path = "/"; $domain = ".tripod.com"; print "Content-type: text/html\n"; print "Set-cookie: $name=$value; date=$cur_date; expires=$expires_date +; path=$path; domain=$domain"; print " <html><body>$cookie</body></html> ";
HELP! What is fishy to me are my dates! And what exactly is that -0500 doing there? (I got this code from somewhere else)


Comment on Re: Recommended modules for handling cookies?
Download Code
RE: Re: Recommended modules for handling cookies?
by btrott (Parson) on Mar 29, 2000 at 03:15 UTC
    I only see one carriage return after the HTTP header. Are you sure you've pasted/typed that in correctly? In your case, you should have the Content-Type header, then a carriage return (which you have), then the Set-Cookie header, then *two* carriage returns... I only see one in your code.

    Again, though, I can't emphasize enough: use CGI::Cookie! Does Tripod not make that available? Is that why you're not using it?

    Also, I've never heard of the "date" attribute in a Set-Cookie header... it's not in the specification. That's probably not the problem, since the cookie is getting placed in your cookies file correctly. But still.

    So this cookie did show up in your cookies file? What's the domain listed as in the cookies file? Is it ".tripod.com"?

RE: Re: Recommended modules for handling cookies?
by plaid (Chaplain) on Mar 29, 2000 at 03:29 UTC
    No real new insight here.. It looks like a newline problem to me. But to answer the other part of your question, one of the standards for writing time involves following the time itself by the offset from GMT. In your case, -0500 would put you 5 hours west of GMT, or somewhere on Eastern Time.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://6387]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2014-07-26 20:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (179 votes), past polls