sKunKbad Posted May 1, 2007 Share Posted May 1, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/49466-sessions-turning-cookies-off/ Share on other sites More sharing options...
taith Posted May 1, 2007 Share Posted May 1, 2007 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!'; } Quote Link to comment https://forums.phpfreaks.com/topic/49466-sessions-turning-cookies-off/#findComment-242427 Share on other sites More sharing options...
sKunKbad Posted May 1, 2007 Author Share Posted May 1, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/49466-sessions-turning-cookies-off/#findComment-242441 Share on other sites More sharing options...
Wildbug Posted May 1, 2007 Share Posted May 1, 2007 See session.use_trans_sid in the PHP session reference. PHP (or you) can put the session ID in URLs if cookies are not enabled/supported. Quote Link to comment https://forums.phpfreaks.com/topic/49466-sessions-turning-cookies-off/#findComment-242477 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.