H
hankology
Cookie refresh questions....
This is what I am currently doing:
# Step 1 - Read and save data from cookie
$XStrX = cookie('X_name');
# Step 2 - Create refreshed cookie with same data
$X_cookie_name = cookie(-name=>'X_name',
-value=>$XStrX,
-expires=>"+2h");
# Step 3 - Write refreshed cookie
print $q->header(-cookie=>$X_cookie_name);
However, the result is that the cookie data prints out on top of the
browser page instead of writing the cookie to the cookie file:
Set-Cookie: CI_name=07TW; path=/; expires=Tue, 03-May-2005 16:42:20 GMT
Date: Tue, 03 May 2005 14:42:20 GMT Content-Type: text/html;
charset=ISO-8859-1
So, if I may, I have three questions:
Why is the above code writing to the browser?
Am I over complicating a cookie refresh, and there is an easier way?
How do I make the cookie go away if the browser is closed?
Thanks!
This is what I am currently doing:
# Step 1 - Read and save data from cookie
$XStrX = cookie('X_name');
# Step 2 - Create refreshed cookie with same data
$X_cookie_name = cookie(-name=>'X_name',
-value=>$XStrX,
-expires=>"+2h");
# Step 3 - Write refreshed cookie
print $q->header(-cookie=>$X_cookie_name);
However, the result is that the cookie data prints out on top of the
browser page instead of writing the cookie to the cookie file:
Set-Cookie: CI_name=07TW; path=/; expires=Tue, 03-May-2005 16:42:20 GMT
Date: Tue, 03 May 2005 14:42:20 GMT Content-Type: text/html;
charset=ISO-8859-1
So, if I may, I have three questions:
Why is the above code writing to the browser?
Am I over complicating a cookie refresh, and there is an easier way?
How do I make the cookie go away if the browser is closed?
Thanks!