|
My problem with setting cookies was learning all the various and
sundries associated with debugging them. I was following the
masonbook.com login pattern, only I was using apache2. It didn't work
as typed and I didn't know how to approach it. I got several suggestions from a query at perlmonks.org, but none of the help. I finally cornered some people on chatterbox that helped me learn how to debug it. 1) To see if the cookie is set by the page, comment out the redirect and use a tool like the liveHTTPheaders plugin for firefox. 2) Check to see if the cookie is being set on the client. For firefox this means clicking tools/options/privacy/cookies/view cookies. With IE you check the file system: C:\documents and settings\username\cookies 3) If you are not seeing the cookie, it is probably some combination of expiration/path/domain that are hosed up. Additional notes: - Assuming a login cookie is used for the whole site, set the path to '/'. Omitting the path will actually set the path to the current directory, which is probably not desirable given the assumption. - Do not set the domain. I'm not sure if you can set this parameter to multiple domains, but every variation on a domain sets a separate cookie. For example, if you specify you domain as www.whatever.com, a client accessing the site as whatever.com will not get the cookie. - One pointer that was given, but not verified, was that Apache2::Cookie expects a string, not a hash as the masonbook.com example shows. I replaced the hash with a comma separated string, but I'm not sure it was necessary as I had other issues at the time. Hope this helps... Jimbus John (Versimedia Admin) wrote: I have a login page using Mason -- where the user types a username/password and if successful, they will be redirected to the front page of the site. |
- [Mason] patch for task 294: support exec/subexec(&... Zach Welch
- [Mason] Redirect + set cookie John (Versimedia Admin)
- Re: [Mason] Redirect + set cookie John Halladay
- Re: [Mason] Redirect + set cookie Jimbus
- Re: [Mason] Redirect + set cookie John Williams
- Re: [Mason] Redirect + set cookie John (Versimedia Admin)
- [Mason] Global variables John (Versimedia Admin)
- Re: [Mason] Global variables RJ Herrick
- Re: [Mason] Global variables Brian Phillips
- Re: [Mason] Global variables John (Versimedia Admin)

