FrogNL Posted March 23, 2011 Share Posted March 23, 2011 I have quite a big problem when a user visits a website using Firefox. When a user logs in and checks the "remember me" checkbox a cookie is stored using this code: [setcookie('LooktureAuth', $cookie, time() + 2678400, '/');/code] This works absolutely perfect in Safari, but when I try to access this cookie in Firefox (using $_COOKIE['LooktureAuth'], the cookie is not showed. When the user go's to an other page though, the cookie is showed. Does anyone have an idea why this is happening? Thanks on forehand! Quote Link to comment Share on other sites More sharing options...
FrogNL Posted March 23, 2011 Author Share Posted March 23, 2011 I just saw I forgot to end the code tag, so the correct post below: I have quite a big problem when a user visits a website using Firefox. When a user logs in and checks the "remember me" checkbox a cookie is stored using this code: [setcookie('LooktureAuth', $cookie, time() + 2678400, '/'); This works absolutely perfect in Safari, but when I try to access this cookie in Firefox (using $_COOKIE['LooktureAuth']), the cookie is not showed. When the user go's to an other page though, the cookie is showed. Does anyone have an idea why this is happening? Thanks on forehand! Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted March 23, 2011 Share Posted March 23, 2011 Are you trying to access the cookie on the same page load as when it is being set? Cookie data isn't supposed to be available until the next page load after the cookie is set. Quote Link to comment Share on other sites More sharing options...
FrogNL Posted March 23, 2011 Author Share Posted March 23, 2011 No, I'm not. The cookie is set quite a long time ago... Quote Link to comment Share on other sites More sharing options...
MrXHellboy Posted March 23, 2011 Share Posted March 23, 2011 More then 31 days ago ? Quote Link to comment Share on other sites More sharing options...
FrogNL Posted March 23, 2011 Author Share Posted March 23, 2011 Thanks for your replies! No, it's set just 10 minutes ago. Quote Link to comment Share on other sites More sharing options...
MrXHellboy Posted March 23, 2011 Share Posted March 23, 2011 Whats your code ? Did you restart your browser ? Quote Link to comment Share on other sites More sharing options...
FrogNL Posted March 23, 2011 Author Share Posted March 23, 2011 Yes, I did restart my browser. You can find a working example http://www.lookture.com (when you log in and check the "remember me" checkbox). I use really basic code, the one I entered in my opening post. Can it be a problem that my cookie has a length of 248 characters? Quote Link to comment Share on other sites More sharing options...
MrXHellboy Posted March 23, 2011 Share Posted March 23, 2011 Well, i guess not since safari is working. Does IE work ? Because this weird issue, i think firefox does delete cookies automatically when closed or whatsoever. Check your brower settings please and i do need your php code Do you have a login for me to use ? Quote Link to comment Share on other sites More sharing options...
FrogNL Posted March 23, 2011 Author Share Posted March 23, 2011 Thanks a lot for your replies! I haven't tested it in Internet Explorer yet, I will do so. Firefox is at its default settings, so it accepts all cookies. I send you a PM with a username and password. Quote Link to comment Share on other sites More sharing options...
MrXHellboy Posted March 23, 2011 Share Posted March 23, 2011 I think i need some code Quote Link to comment Share on other sites More sharing options...
FrogNL Posted March 23, 2011 Author Share Posted March 23, 2011 What code do you need? Where I set the cookie? Or where I read the cookie? Quote Link to comment Share on other sites More sharing options...
MrXHellboy Posted March 23, 2011 Share Posted March 23, 2011 Actually both Quote Link to comment Share on other sites More sharing options...
FrogNL Posted March 24, 2011 Author Share Posted March 24, 2011 Thanks for your replies! I set the cookie when the user is logging in on login.php using the following code: setcookie('LooktureAuth', $cookie, time() + 2678400, '/'); and read it using the following code: $auth = $_COOKIE['LooktureAuth']; Any idea? Quote Link to comment Share on other sites More sharing options...
FrogNL Posted March 25, 2011 Author Share Posted March 25, 2011 Any idea?? Quote Link to comment Share on other sites More sharing options...
FrogNL Posted March 27, 2011 Author Share Posted March 27, 2011 Nobody? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.