Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Cookie Reading Problem

by rnewsham (Curate)
on Jun 27, 2013 at 06:39 UTC ( [id://1040922]=note: print w/replies, xml ) Need Help??


in reply to Cookie Reading Problem

Have you checked the host value for the cookies? For example are the cookies created on http://www.foo.com/ and your script running on http://foo.com or vice-versa.

Replies are listed 'Best First'.
Re^2: Cookie Reading Problem
by Mr. Newb (Acolyte) on Jun 27, 2013 at 11:25 UTC
    Hmmm.. that might be the problem. Does that make a difference? I can't remember at the moment, but I think i did not specify the domain name in the cookie when I set it. Does the CGI module automatically set it, if you don't specify one?

      Below is an extract from the documentation for CGI which should clear things up. See the full documentation at HTTP COOKIES for full details.

      " a domain This is a partial or complete domain name for which the cookie is valid. The browser will return the cookie to any host that matches the partial domain name. For example, if you specify a domain name of ".capricorn.com", then the browser will return the cookie to Web servers running on any of the machines "www.capricorn.com", "www2.capricorn.com", "feckless.capricorn.com", etc. Domain names must contain at least two periods to prevent attempts to match on top level domains like ".edu". If no domain is specified, then the browser will only return the cookie to servers on the host the cookie originated from."

        Yes, that was the problem - the cookie was set at www.mysite.com, and I was trying to read it at mysite.com. Thanks so much!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-24 02:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found