4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Cookies problem
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Iyonix
WebHelper
WebHelper


Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England

PostPosted: Sat Feb 14, 2004 10:25 pm (20 years, 2 months ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by IyonixSend Personal Message
OllieMaitland
Junior WebHelper
Junior WebHelper


Joined: 06 Dec 2003
Posts: 25

PostPosted: Sun Feb 15, 2004 10:44 pm (20 years, 2 months ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by OllieMaitlandSend Personal MessageSend email
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Mon Feb 16, 2004 9:01 am (20 years, 2 months ago) Reply with QuoteBack to Top

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 Smile

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
Marinamus
Junior WebHelper
Junior WebHelper


Joined: 30 Nov 2014
Posts: 5
Location: USA

PostPosted: Sun Dec 07, 2014 8:58 pm (9 years, 4 months ago) Reply with QuoteBack to Top

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:
OfflineView User's ProfileFind all posts by MarinamusSend Personal MessageSend emailICQ Number
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




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.209454 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme