Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 6th, 2006, 5:15 PM   #1
ASHORY
Programmer
 
ASHORY's Avatar
 
Join Date: Dec 2004
Location: Egypt
Posts: 30
Rep Power: 0 ASHORY is on a distinguished road
Send a message via ICQ to ASHORY Send a message via MSN to ASHORY Send a message via Yahoo to ASHORY
Delete Cookie ..

Hey .

I am working on a loggin system built on setting cookies for users ,
setcookie(Username, Value, time()+300);
//Cookie Ends after 5 Minutes

and now i want to logout this user so i used to delete the cookie
setcookie(Username, Value, mktime(12,0,0,1, 1, 1990));
//Cookie will end at past time so it will be deleted immediatly


so after all of that , the cookie still exist i dont know what to do

please any one help me

__________________
"^Ahmed.SHOukRY^"
http://www.ashory.741.com
ASHORY is offline   Reply With Quote
Old Jul 6th, 2006, 7:44 PM   #2
Booooze
Expert Programmer
 
Booooze's Avatar
 
Join Date: Mar 2006
Location: Igloo
Posts: 710
Rep Power: 3 Booooze is on a distinguished road
Send a message via MSN to Booooze
I recall there being a simpler way to reset or delete cookies. If you google this topic, you will find that you should be able to reset a cookie by simply specifying it name only.

setcookie("test");

That code would reset the cookie named test to basicly nothing.
Booooze is offline   Reply With Quote
Old Jul 9th, 2006, 9:48 PM   #3
BlazingWolf
Hobbyist Programmer
 
Join Date: Sep 2004
Posts: 207
Rep Power: 5 BlazingWolf is on a distinguished road
[php]setcookie("cookiename", "", time()-300);[/php]
__________________
_______________________________
BlazingWolf
BlazingWolf is offline   Reply With Quote
Old Jul 10th, 2006, 3:09 PM   #4
ASHORY
Programmer
 
ASHORY's Avatar
 
Join Date: Dec 2004
Location: Egypt
Posts: 30
Rep Power: 0 ASHORY is on a distinguished road
Send a message via ICQ to ASHORY Send a message via MSN to ASHORY Send a message via Yahoo to ASHORY
@BlazingWolf
My Code is Similar to yours and its didnt work

@Booooze
The Code didnt work to so when i go to the url to the page it must say "you r not signed in" but it worked , i waited till the cookie expired and it said that successfully , so whats wrong
__________________
"^Ahmed.SHOukRY^"
http://www.ashory.741.com
ASHORY is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:05 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC