vasavi
asked on
Cookie problem
Hi all,
I need to set a cookie in the client machine and then display some html content. The problem is, I am supposed to set the cookie using perl code which is an include file in a .shtml page.
Thanks in advance,
Vasavi.
I need to set a cookie in the client machine and then display some html content. The problem is, I am supposed to set the cookie using perl code which is an include file in a .shtml page.
Thanks in advance,
Vasavi.
vasavi,
a further example of setting a cookie:
$c = new CGI::Cookie(-name => 'foo',
-value => 'bar',
-expires => '+3M',
-domain => '.capricorn.com',
-path => '/cgi-bin/database'
-secure => 1
);
a good resource site for cooies is: http://www.cookiecentral.com/
regards Peewee
a further example of setting a cookie:
$c = new CGI::Cookie(-name => 'foo',
-value => 'bar',
-expires => '+3M',
-domain => '.capricorn.com',
-path => '/cgi-bin/database'
-secure => 1
);
a good resource site for cooies is: http://www.cookiecentral.com/
regards Peewee
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
vasavi,
please clean up the status of this question?
regards Peewee
please clean up the status of this question?
regards Peewee
Force Accepted
SpideyMod
Community Support Moderator @Experts Exchange
SpideyMod
Community Support Moderator @Experts Exchange
here is example use of setting a cookie within your perl script, there are many different ways of doing this:
use CGI qw/:standard/;
use CGI::Cookie;
# Create new cookies and send them
$cookie1 = new CGI::Cookie(-name=>'ID',-v
$cookie2 = new CGI::Cookie(-name=>'prefer
-value=>{ font => Helvetica,
size => 12 }
);
print header(-cookie=>[$cookie1,
============= feteching them ==================
# fetch existing cookies
%cookies = fetch CGI::Cookie;
$id = $cookies{'ID'}->value;
# create cookies returned from an external source
%cookies = parse CGI::Cookie($ENV{COOKIE});
regards
Peewee