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! Link to comment https://forums.phpfreaks.com/topic/231495-firefox-cookie-only-on-second-request/ 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! Link to comment https://forums.phpfreaks.com/topic/231495-firefox-cookie-only-on-second-request/#findComment-1191332 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. Link to comment https://forums.phpfreaks.com/topic/231495-firefox-cookie-only-on-second-request/#findComment-1191334 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... Link to comment https://forums.phpfreaks.com/topic/231495-firefox-cookie-only-on-second-request/#findComment-1191394 Share on other sites More sharing options...
MrXHellboy Posted March 23, 2011 Share Posted March 23, 2011 More then 31 days ago ? Link to comment https://forums.phpfreaks.com/topic/231495-firefox-cookie-only-on-second-request/#findComment-1191402 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. Link to comment https://forums.phpfreaks.com/topic/231495-firefox-cookie-only-on-second-request/#findComment-1191403 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 ? Link to comment https://forums.phpfreaks.com/topic/231495-firefox-cookie-only-on-second-request/#findComment-1191406 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? Link to comment https://forums.phpfreaks.com/topic/231495-firefox-cookie-only-on-second-request/#findComment-1191408 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 ? Link to comment https://forums.phpfreaks.com/topic/231495-firefox-cookie-only-on-second-request/#findComment-1191414 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. Link to comment https://forums.phpfreaks.com/topic/231495-firefox-cookie-only-on-second-request/#findComment-1191420 Share on other sites More sharing options...
MrXHellboy Posted March 23, 2011 Share Posted March 23, 2011 I think i need some code Link to comment https://forums.phpfreaks.com/topic/231495-firefox-cookie-only-on-second-request/#findComment-1191435 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? Link to comment https://forums.phpfreaks.com/topic/231495-firefox-cookie-only-on-second-request/#findComment-1191438 Share on other sites More sharing options...
MrXHellboy Posted March 23, 2011 Share Posted March 23, 2011 Actually both Link to comment https://forums.phpfreaks.com/topic/231495-firefox-cookie-only-on-second-request/#findComment-1191440 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? Link to comment https://forums.phpfreaks.com/topic/231495-firefox-cookie-only-on-second-request/#findComment-1191799 Share on other sites More sharing options...
FrogNL Posted March 25, 2011 Author Share Posted March 25, 2011 Any idea?? Link to comment https://forums.phpfreaks.com/topic/231495-firefox-cookie-only-on-second-request/#findComment-1192289 Share on other sites More sharing options...
FrogNL Posted March 27, 2011 Author Share Posted March 27, 2011 Nobody? Link to comment https://forums.phpfreaks.com/topic/231495-firefox-cookie-only-on-second-request/#findComment-1192916 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.