Results 1 to 6 of 6

Thread: Cookies. Works in FF but not IE -[RESOLVED]-

  1. #1

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349

    Resolved 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.

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Cookies. Works in FF but not IE

    Could you post the code which creates the cookie?
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349

    Re: Cookies. Works in FF but not IE

    Just the line where is creates it?
    PHP Code:
    setcookie("logincode"$UserGUIDtime()+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.

  4. #4

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    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.

  5. #5

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349

    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.

  6. #6
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    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.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width