Results 1 to 5 of 5

Thread: Delete cookie

  1. #1
    Senior Member pmbguy's Avatar
    Join Date
    Nov 2008
    Location
    South Africa
    Posts
    310
    Thanks
    96
    Thanked 207 Times in 63 Posts
    Rep Power
    0

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

  2. #2
    Senior Member softwarefreak's Avatar
    Join Date
    Jun 2011
    Location
    http://softwarefreak.in
    Posts
    347
    Thanks
    142
    Thanked 211 Times in 69 Posts
    Rep Power
    2

    Default

    Quote Originally Posted by pmbguy [Only registered and activated users can see links. Click Here To Register...]
    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 at 06:55.
    I need some facebook likes, can you please help me
    [Only registered and activated users can see links. Click Here To Register...]
    I noticed social media is really powerful
    Well DONE is better than well SAID

  3. #3
    Senior Member pmbguy's Avatar
    Join Date
    Nov 2008
    Location
    South Africa
    Posts
    310
    Thanks
    96
    Thanked 207 Times in 63 Posts
    Rep Power
    0

    Default

    you mean something like this?

    $timeout = time() - (60 * 24 * 60 * 60);
    setcookie ("uvw999", "", $timeout "/");

  4. #4
    Senior Member softwarefreak's Avatar
    Join Date
    Jun 2011
    Location
    http://softwarefreak.in
    Posts
    347
    Thanks
    142
    Thanked 211 Times in 69 Posts
    Rep Power
    2

    Default

    Quote Originally Posted by pmbguy [Only registered and activated users can see links. Click Here To Register...]
    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
    [Only registered and activated users can see links. Click Here To Register...]
    I noticed social media is really powerful
    Well DONE is better than well SAID

  5. #5
    Senior Member shushant's Avatar
    Join Date
    Feb 2011
    Location
    Root
    Posts
    197
    Thanks
    39
    Thanked 36 Times in 20 Posts
    Rep Power
    3

    Default

    Quote Originally Posted by pmbguy [Only registered and activated users can see links. Click Here To Register...]
    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 at 16:18.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Detect cookie
    By jaidon20k in forum Coding Forum
    Replies: 2
    Last Post: 15-10-11, 08:59
  2. cookie for lava
    By jaidon20k in forum Tutorials
    Replies: 21
    Last Post: 21-04-11, 11:39
  3. Cookie security
    By ripkk2tfk in forum Site / Script testing and error fixing
    Replies: 7
    Last Post: 26-01-10, 12:04
  4. cookie error
    By wapmetal in forum Site / Script testing and error fixing
    Replies: 9
    Last Post: 08-12-09, 16:09
  5. cookie error
    By ori in forum Site / Script testing and error fixing
    Replies: 12
    Last Post: 04-06-09, 08:21

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
  •  

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19