|
-
Feb 16th, 2005, 01:11 PM
#1
Thread Starter
Ex-Super Mod'rater
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 .
Last edited by Electroman; Feb 16th, 2005 at 06:39 PM.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Feb 16th, 2005, 06:00 PM
#2
Re: Cookies. Works in FF but not IE
Could you post the code which creates the cookie?
-
Feb 16th, 2005, 06:15 PM
#3
Thread Starter
Ex-Super Mod'rater
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.
Last edited by Electroman; Feb 16th, 2005 at 06:18 PM.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Feb 16th, 2005, 06:25 PM
#4
Thread Starter
Ex-Super Mod'rater
I just made a script with the following code:
PHP Code:
<?
setcookie("logincode", "49ab9a09eb0cd47e6e37afa9a35e3778", time()+60*15, "/", "foxhunters.ElectromanUK.com", 0);
if (isset($_COOKIE['logincode']))
echo $_COOKIE['logincode'];
else
echo "No Cookie";
?>
Its at http://foxhunters.electromanuk.com/test.php and if i run it in IE I get "No Cookie".
EDIT: After reloading the page too .
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Feb 16th, 2005, 06:32 PM
#5
Thread Starter
Ex-Super Mod'rater
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 .
Last edited by Electroman; Feb 16th, 2005 at 06:55 PM.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Feb 16th, 2005, 06:59 PM
#6
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|