Jump to content

Sessions / Turning Cookies Off


sKunKbad

Recommended Posts

I have a script on a godaddy server, and it uses a session, and works fine unless I turn cookies off. Maybe I am wrong, but in theory, I thought that if I turned off cookies in the browser I am testing with, that php would automatically use some other way to store the session information. Unfortunately, when I turn cookies off in the browser, the script does not continue to work. I checked the phpinfo(), and the session.save_path is set to /tmp. I tried adding

session_save_path("/home/content/a/b/c/abc/html/tmp");

before my call for the session to start, but it doesn't help.

Am I wrong about sessions working if cookies are turned off?

Link to comment
https://forums.phpfreaks.com/topic/49466-sessions-turning-cookies-off/
Share on other sites

no... servers first store the cookie on the browser, then relate to it every time...

you can do a simple test first...?

 

setcookie("test","test",time()+3600);

if(empty($_COOKIE[test])){

echo 'Please enable cookies!';

}

 

So, if cookies are turned off, the session will never work?

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.