HighDots Forums  

cookie expiration is not working....

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss cookie expiration is not working.... in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael Fesser
 
Posts: n/a

Default Re: cookie expiration is not working.... - 07-20-2004 , 04:12 PM






.oO(msa)

Quote:
I have the following code for my cookie, on the login page:
[...]
setcookie("acCookie",$HTTP_POST_VARS['UserName'],time() + 7200,"/");
setcookie("levelCookie",$row_rsLogin['UserAccess'],time() + 7200,"/");
[...]

I would like the cookie to expire upon closing the browser....but it doesn't
work. (php/MySQL)
For session cookies don't set an expire time (it's currently set two
hours = 7.200s ahead). The third parameter of setcookie() specifies the
expire time, leave it empty or set it to 0 if you need to set the fourth
parameter.

Quote:
why why why????

thanks thanks thanks!!!
HTH HTH HTH
Micha Micha Micha


Reply With Quote
  #2  
Old   
msa
 
Posts: n/a

Default cookie expiration is not working.... - 07-20-2004 , 04:14 PM






I have the following code for my cookie, on the login page:

if($HTTP_POST_VARS['action']=="login"){
if($totalRows_rsLogin==0){
$errorMessage = "Your login information is incorrect. Please try again.";
mysql_free_result($rsLogin);
} else {
mysql_free_result($rsLogin);
setcookie("acCookie",$HTTP_POST_VARS['UserName'],time() + 7200,"/");
setcookie("levelCookie",$row_rsLogin['UserAccess'],time() + 7200,"/");
// Expire Date: 0
// Expire Time: 00:00:00
header("Location: secure/sales.php");
}

I would like the cookie to expire upon closing the browser....but it doesn't
work. (php/MySQL)

why why why????

thanks thanks thanks!!!



Reply With Quote
  #3  
Old   
msa
 
Posts: n/a

Default Re: cookie expiration is not working.... - 07-21-2004 , 08:41 AM



thanks, that is working..

"Michael Fesser" <netizen (AT) gmx (DOT) net> wrote

Quote:
.oO(msa)

I have the following code for my cookie, on the login page:
[...]
setcookie("acCookie",$HTTP_POST_VARS['UserName'],time() + 7200,"/");
setcookie("levelCookie",$row_rsLogin['UserAccess'],time() + 7200,"/");
[...]

I would like the cookie to expire upon closing the browser....but it
doesn't
work. (php/MySQL)

For session cookies don't set an expire time (it's currently set two
hours = 7.200s ahead). The third parameter of setcookie() specifies the
expire time, leave it empty or set it to 0 if you need to set the fourth
parameter.

why why why????

thanks thanks thanks!!!

HTH HTH HTH
Micha Micha Micha



Reply With Quote
Reply




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.