Jump to content

Firefox and path of cookies root


bestrong

Recommended Posts

I am trying to set a cookie

 

setcookie('bbs_logged_in', 1, 7200+time(),"/");

 

Here is the issue

 

If i close the window and go to http://www.website.com/

 

the cookie is not set  :confused:

 

BUT

 

if I type in http://www.website.com/index.php

 

the cookie shows up fine.

 

This is only the case in firefox, IE works fine  :facewall:

 

any ideas?

 

 

Link to comment
https://forums.phpfreaks.com/topic/168052-firefox-and-path-of-cookies-root/
Share on other sites

i set up the exact same conditions you specify and it did work for me? how do you know the cookie is not set, do you test if it exists on the same page? just checking, cause you cannot set a cookie and then test to see if it is there in the same script...

 

what version firefox?

Ok, I created a example for you

 

go to

http://www.dev.bluebeanstalk.com/make_cookie.php

 

enter a cookie value

 

then open a new firefox window and go to http://www.dev.bluebeanstalk.com/index.php

 

The cookie will show at the top of the page as cookie is: [your cookie value here]

 

now, close that window, and re open a new window and go to  http://www.dev.bluebeanstalk.com

 

The cookie value will be blank

 

Must be in firefox

 

Thanks.

 

 

 

 

 

but you might want to add the domain parameter in your setcookie function (.bluebeanstalk.com)... make sure you include beginning ".", since you are using multiple subdomains, it will make it compatible with more browsers... that could cause issues...

 

setcookie('bbs_logged_in', 1, 7200+time(),"/",".bluebeanstalk.com");

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.