SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jan 2006
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    setcookie and IE7

    Im using:

    PHP Code:
    setcookie("x","$newsessionid",time()+3600,"/","x.com",0); 
    to set a cookie, then i get it with $_COOKIE.

    It works perfectly in Firefox, however, its giving me a headache in IE7... i believe it worked fine in IE6.

    I searched google for over 90 minutes now.... and can't come up with some helpful advice.

    If anyone could point me in the right direction, i'd be very grateful.

  2. #2
    SitePoint Member
    Join Date
    Jan 2006
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    K if anyone is ever having trouble with this and is puzzled, do not bother searching for help as you'll not find anything on google... what i found is that firefox works fine with any time you set for expiration, whereas Internet Explorer does not accept short spans of time, 30minutes or 1 hour doesn't work, so your solution is setting many hours or just putting 0 for expiration time so it expires when browser closes.

    IMO, IE is lame. Sigh took me 3 hours to come up with a solution

  3. #3
    SitePoint Enthusiast Azmeen's Avatar
    Join Date
    Apr 2007
    Location
    Johor Bahru, Johor, Malaysia
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm pretty sure the cookie timing mechanism for IE is working fine.

    Usually, the timing for cookie expiration should ideally be long enough to take into account the timezone differences between the server and the client PC, which is why having cookies that expire less than 2 days would always be an iffy thing.
    I can help with Linux, Apache, MySQL and PHP stuff at most times.
    I may be able to assist in other general IT issues. Try me
    Web Sites I Run:
    HTNet | Welley Corporation | blings.info

  4. #4
    SitePoint Enthusiast BlogPatrol's Avatar
    Join Date
    Oct 2004
    Location
    East Coast, USA
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up Thanks so much, both your solutions helped!

    Seiya and Azmeen, Thanks for posting this info. We recently encountered similar cookie issues with not only IE7, but also IE6, for BlogPatrol.

    We documented the solution, and credited both of you by linking to this SitePoint thread, in the status report on the companion blog titled, The Patrol Blog.
    BlogPatrol.com - Free Blog Counters, Widgets and Stats
    Sign up | Demo | The Patrol Blog | Contact Us

  5. #5
    SitePoint Enthusiast BlogPatrol's Avatar
    Join Date
    Oct 2004
    Location
    East Coast, USA
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up Thanks, Part 2

    This may sound funny, but we actually used this solution a second time with the same good results.

    We changed web developers about six months ago. The developer inadvertently changed the setting back to one hour, which caused the error to recur. Once the developer increased the value, then the problem went away.

    Thanks again!
    BlogPatrol.com - Free Blog Counters, Widgets and Stats
    Sign up | Demo | The Patrol Blog | Contact Us


Bookmarks

Posting Permissions

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