johnsmith153 — 2012-08-30T23:43:01-04:00 — #1
Everything I create in PHP, and when using $_SESSION, will just fail to work if cookies are off.
I notice that with many sites, including sitepoint.com that it will automatically append the session id to the URL if cookies are off. So you can still log in and use Sitepoint even if cookies are turned off in the browser.
I can't get PHP to automatically do this, so what should I do? I just need to get PHP to register the value in the URL (if cookies are off), where as at the moment it just doesn't maintain the session if cookies are off.
I'm guessing an answer might be something like: (1) append phpsessid=123 etc. to the URL and (2) add a certain setting to php.ini.
logic_earth — 2012-08-31T00:06:23-04:00 — #2
johnsmith153 — 2012-08-31T00:16:02-04:00 — #3
Thanks, but just setting these values isn't doing anything.
Also, adding a random value as the session id (?PHPSESSID=123hhh) isn't working either.
Do I need to do anything else?
johnsmith153 — 2012-08-31T01:28:16-04:00 — #4
Now I've thought about it, I think it might be better to use JS/HTML5 local storage as a fallback if cookies are turned off.
I can do the JS, but how do I do the server-side part? Is this even possible?
Maybe I should post in the JS forum.
johnsmith153 — 2012-08-31T01:36:44-04:00 — #5
If cookies are turned off then I would like to use local/session storage to maintain the session id.
I can do the JS code for local/session storage, but how do I store a session id and maintain it etc?
spacephoenix — 2012-08-31T02:36:34-04:00 — #6
For future reference, if you feel a thread needs moving to a more appropriate forum, please click the report post button for the last post of the thread stating which forum the thread needs moving to. Thanks