Jump to content

Firefox cookie only on second request


FrogNL

Recommended Posts

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

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!

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?

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 ?

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.