Guest Posted July 16, 2003 Share Posted July 16, 2003 Here's some information that I though might save others some time. My apologies if there is already a thread on this. I didn't see one. When I installed osc 2.2 milestone 2 and enabled "Force Cookie Use", I found that I could no longer add a product to the cart or do any of the tasks where cookie use in enforced. To troubleshoot, I did the following I check and double checked and double checked again that my browser supported cookies. I tried other computers with other browser versions still no luck. I searched the forum and saw lots of happy people using this feature, so I figured it had to be my problem. I saw some forum posts from May and June that started to shed some light on the problem, but still no solution. Then I searched the php manuel, and in the comments of setcookie page (http://us4.php.net/manual/en/function.setcookie.php), I found this: When developing web applications on your local machine and using "localhost" as your domain, cookies will not be set correctly using IE6 (maybe other IEs as well) if you specify "localhost" as your domain when using setCookie(). If you read the Netscape spec, there is a note: Bingo! On my development server, I don't set HTTP_SERVER to http://localhost, but I do set it to http://mycomputername. From what I've read, some browsers require the domain name used in cookies to have either 2 or 3 . (dots) in it. This means setting HTTP_SERVER to localhost won't work. However using the IP address will. Unfortunately, I wasted some more time here, because in my haste to test I changed HTTP_SERVER, but I forgot to also change HTTP_COOKIE_DOMAIN. So to summarize, if you're using Force Cookies Enabled and your sites not working even though you're sure cookies are enabled, then if you have the a domain with less than 2 . (dots) in it. For example: define('HTTP_SERVER', 'http://localhost'); define('HTTP_COOKIE_DOMAIN', 'localhost'); then try changing to your ip address or some other domain with 2 or more . (dots). For example: define('HTTP_SERVER', 'http://192.168.1.100'); define('HTTP_COOKIE_DOMAIN', '192.168.1.100'); Hope this helps, -Chandra Link to comment Share on other sites More sharing options...
yavuz Posted November 22, 2003 Share Posted November 22, 2003 Hi Chandra, I wish I have found this info last week. Nevertheless it saved me too much time... Thanks for the info :D Link to comment Share on other sites More sharing options...
redgorilla Posted May 22, 2006 Share Posted May 22, 2006 Thank you Chandra :-) Link to comment Share on other sites More sharing options...
pbor1234 Posted July 14, 2008 Share Posted July 14, 2008 Or add a virtual path to your hosts file.... www.test.com 127.0.0.1 Link to comment Share on other sites More sharing options...
stanec Posted April 2, 2010 Share Posted April 2, 2010 Thank you so much about this tips, i was goin crazy because this! :) Link to comment Share on other sites More sharing options...
Jack_mcs Posted April 2, 2010 Share Posted April 2, 2010 This define('HTTP_COOKIE_DOMAIN', '192.168.1.100'); should be define('HTTP_COOKIE_DOMAIN', '.192.168.1.100'); Force Cookies should never be used, in my opinion. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
HaroonSheikh Posted May 25, 2011 Share Posted May 25, 2011 I'm having a similar issue with my website. I enabled cookie use from admin page, but now when I go back to admin page, I can't seem to log back in to do anything. It just redirects me to the admin login page again. Could someone help please ? Is there a way to turn off force cookie use manually? (through database, etc...) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.