Topic: Cookie problems with v0.93 - possibly bugs? Includes suggestions... (Read 243 times)
I crack Photoshop!
Gender:
Posts: 3
22 credits Members referred : 0
« on: Jun 06, 2008, 07:08:34 AM »
I was troubleshooting some things today, getting this class to work. I've come across a couple of peculiarities in the process. This is all done using Safari 3.1.1 on OSX.5.3, PHP 5.2.5, Apache 2.2.8.
1 - I was unable to set a cookie in the login() function while testing on localhost. Setting the cookie domain to any value at all caused the browser to reject it & not set the cookie. Removing the final parameter from the setcookie() call fixed it.
2 - The logout() function was not removing my cookie. The setcookie() call in this function was re-setting the cookie, but omitted the path parameter. This had the effect of setting a new cookie with the same name, but the path parameter defaulted to a different value (in my case, /phpUserClass). Adding '/' as the fourth parameter to the setcookie() call in the logout() function fixed this.
I hope this is helpful. Now that I have the basic login/logout working, I can't wait to get this integrated into a couple of new CMS projects I'm building. Are there any issues I'm missing that might arise from leaving off the domain parameter while setting the cookie? It seems to be common to have problems setting cookies on localhost with Apache. I couldn't come up with any value that would work.
Thanks for all your hard work and for releasing this sweet class!
Cheers, Kris
« Last Edit: Jun 06, 2008, 06:19:42 PM by kris_mcl »
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7769