SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2004
    Location
    Cape Cod
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cookie removal with PHP problem

    I have built a custom CMS for a client and now they want a remember me checkbox under the log in form. On my local machine this works perfectly but on the live server which is a Rackspace cloud site I cannot seem to get rid of the cookies.

    right now I am using setcookie('cookieName','',1);

    I have also tried setcookie('cookieName','',time()-3600);

    like I said this is working perfectly on my local machine so any ideas as to why this would not work on the live server or suggestions on things to try would be very appreciated.

    Thanks
    Don

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Test the value of the cookie not whether it exists or not.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Zealot
    Join Date
    Jan 2004
    Location
    Cape Cod
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The cookies are not being changed at all. Any idea why on my local machine they would be gone but on the live machine not changed at all?

  4. #4
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Do you change the page...ie., redirect them to another page? Or cause the browser to reissue an HTTP request? A cookie won't change until a browser either reissues an HTTP request or you redirect them to a new page.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  5. #5
    SitePoint Zealot
    Join Date
    Jan 2004
    Location
    Cape Cod
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Logic but I ended up figuring out the problem with some help of an admin over at rackspace. This might help someone else who is using their cloud sites platform. It has something to do with the way they do their load balancing so instead of trying to get rid of the cookie you should just set it to '0' and then test for this. Like your first response, so to solve the problem on logout I set the three cookies to a value of '0' making the worthless and easy to test against.


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
  •