Cookies. Works in FF but not IE -[RESOLVED]-
On my login page it creates a cookie if you login correct. However I've just noticed that for IE this has stopped working. The appropriate code is run where the cookie is sent however it only seems to create the cookie if you are using FF.
It used to work on both but i can't for the life of me think what i could have changed to have this effect.
P.S. its not the setting on my IE cos I got Note to test it and it was the same. I even set IE to prompt before all cookies and it doesn't do anything :(.
Re: Cookies. Works in FF but not IE
Could you post the code which creates the cookie?
Re: Cookies. Works in FF but not IE
Just the line where is creates it?
PHP Code:
setcookie("logincode", $UserGUID, time()+60*15, "/", "foxhunters.ElectromanUK.com", 0);
I'll do a little test to check the line is actually getting run, mind can't see how the browser would effect it.....
EDIT: Yea the line is run because the Db gets an entry added as if the cookie was saved normally.
Re: Cookies. Works in FF but not IE
Ar, I increased the time and it has now worked. Any idea why only IE deletes it straight away. also how can I create a cookie that will last only 15minutes when the server is in a different time zone?
I have an admin option to set the differance between time zones of the server and place of use so i could use tht if there isn't a better way.
EDIT: update: Seems my servers time is slow by 20minutes causing this problem :(.
Re: Cookies. Works in FF but not IE -[RESOLVED]-
It sounds like the server time is off, compared to the time on your PC. You should never rely on cookie expiry times and instead use the server timel. I.e: record the time of the users latest request and if this is greater than the expiry time then make them login again.
You can make the make the cookie expire when the browser closes by setting the time field to null, then let the script do the rest of the work.