Jump to content

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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.