Delete cookie

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Delete cookie

    Hi, im having a problem with deleting a cookie. when i set the cookie i set it for time()+3600 to set it for an hour... when i delete i set time to time()- 24*60*60 but cookie not deleting... i tried 0 which should drop cookie when browser closes n still nothing... i am now clueless as to whats going on...
    C3 Themes: http://c3themes.wen.ru/index.html
    Find Files: http://mystarter.tk/?goto=X-search

    #2
    Originally posted by pmbguy View Post
    Hi, im having a problem with deleting a cookie. when i set the cookie i set it for time()+3600 to set it for an hour... when i delete i set time to time()- 24*60*60 but cookie not deleting... i tried 0 which should drop cookie when browser closes n still nothing... i am now clueless as to whats going on...
    Try the time in sec, it shud work
    PHP Code:
    setcookie('user''someone'time() - 2592000'/'); 
    Added after 2 minutes:

    if you wana to let cookie expireswhen the browser is closed, skip the time() param
    PHP Code:
    setcookie('user''someone'); 
    Last edited by softwarefreak; 23.04.12, 06:55.
    I need some facebook likes, can you please help me
    http://facebook.com/softwarefreakin
    I noticed social media is really powerful
    Well DONE is better than well SAID

    Comment


      #3
      you mean something like this?

      $timeout = time() - (60 * 24 * 60 * 60);
      setcookie ("uvw999", "", $timeout "/");
      C3 Themes: http://c3themes.wen.ru/index.html
      Find Files: http://mystarter.tk/?goto=X-search

      Comment


        #4
        Originally posted by pmbguy View Post
        you mean something like this?

        $timeout = time() - (60 * 24 * 60 * 60);
        setcookie ("uvw999", "", $timeout "/");
        Yes,
        PHP Code:
        $expire time() - 5184000;
        setcookie ("uvw999""somedata"$expire); 
        I need some facebook likes, can you please help me
        http://facebook.com/softwarefreakin
        I noticed social media is really powerful
        Well DONE is better than well SAID

        Comment


          #5
          Originally posted by pmbguy View Post
          you mean something like this?

          $timeout = time() - (60 * 24 * 60 * 60);
          setcookie ("uvw999", "", $timeout "/");
          Lets this is ur initial Cookie
          Code:
          $till = 5184000; 
          setcookie("key", "var", $till);
          to reset
          Code:
          $till = 100; 
          setcookie("key", "gone", $till);
          Last edited by shushant; 29.04.12, 16:18.

          Comment

          Working...
          X