![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
|
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 |
|
|
|
|
|
#2 |
|
Expert Programmer
|
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. |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
Join Date: Sep 2004
Posts: 207
Rep Power: 5
![]() |
[php]setcookie("cookiename", "", time()-300);[/php]
__________________
_______________________________ BlazingWolf |
|
|
|
|
|
#4 |
|
Programmer
|
@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 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|