-
A cookie for the current server, that expires when the user quits the browser
Set-cookie: color=red
Content-type: text/html
-
A cookie for the current server, that has an expiration data. The default
is for when the browser closes.
Set-cookie: color=red; expires=Friday, 03-April-98 13:34:20 GMT
Content-type: text/html
-
A cookie that is for only a particular path. The default is for the entire
domain.
Set-cookie: color=red; path=/scripts
Content-type: text/html
-
A cookie for a particular file
Set-cookie: color=red; path=/scripts/foobar.pl
Content-type: text/html
-
A cookie for a particular domain. The default is the current domain.
Set-cookie: color=red; domain=www.fiu.edu
Content-type: text/html
-
A cookie for a group of domains
Set-cookie: color=red; domain=.fiu.edu
Content-type: text/html
-
I have included a function in CGILib that will generate the current time
in GMT format. The function has an optional parameter that will allow you
to create a date in the future, by passing the number of seconds in the future.
#current time in the format that Set-cookie wants
$now = time_gmt();
#30 seconds in the future in the format that Set-cookie wants
$future = time_gmt(30);