|
Author |
Message |
Iyonix
WebHelper
Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England
|
Posted:
Sat Feb 14, 2004 10:25 pm (20 years, 9 months ago) |
|
I can login to my script fine with this
Code: | setcookie("user",$userc,time()+99999, "/"); // Set cookies
setcookie("pass",$fpass,time()+99999, "/");
|
but the logout won't logout with this
Code: |
setcookie("user"," ",time()-3600,"/"); // Delete cookies
setcookie("pass"," ",time()-3600,"/");
|
|
________________________________ Iyonix |
|
|
|
OllieMaitland
Junior WebHelper
Joined: 06 Dec 2003
Posts: 25
|
Posted:
Sun Feb 15, 2004 10:44 pm (20 years, 9 months ago) |
|
The cookie will only set the cookie on loading the page...hence when building the page the values of the cookies are still as they were from the previous page... to make the cookie unset for the loading of the logout page you could use:
Code: |
setcookie("user","",time()-3600,"/"); // notice no space
unset($_COOKIE['user']);
setcookie("pass","",time()-3600,"/");
unset($_COOKIE['pass']);
|
or you could use:
Code: |
setcookie("user","",time()-3600,"/"); // notice no space
$_COOKIE['user']="";
setcookie("pass","",time()-3600,"/");
$_COOKIE['pass']="";
|
...i don't know whicj would be considered better coding ;o |
|
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Mon Feb 16, 2004 9:01 am (20 years, 9 months ago) |
|
OllieMaitland wrote: | ...i don't know whicj would be considered better coding ;o |
I would say the first one, but I don't know why |
________________________________ It's turtles all the way down... |
|
|
|
Marinamus
Junior WebHelper
Joined: 30 Nov 2014
Posts: 5
Location: USA
|
Posted:
Sun Dec 07, 2014 8:58 pm (9 years, 11 months ago) |
|
ok i have figured out the problem with this and the problem was how i done the datapath.cs
instead of doing like this
Code: |
|
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.130948 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |