while(my $ref=$sth->fetchrow_hashref()){
use CGI::Cookie;
my $query = new CGI;
my $cookie = $query->cookie(-name=>'oreo',
-value=>"|$ref->{'value1'}|$ref->{'value2'}",
-expires=>'',
-path=>'http://somewhere.com/cgi-bin/admin/');
print header(-cookie=>$cookie);
&lalaland;
}
my($value1,$value2,$value3);
my $dbh = DBI->connect('connection paramaters') or die("Couldnt connect");
my $query = "select blah1,blah2,blah3" . " from table where binary column_name = '$_[0]' limit 1";
($value1,$value2,$value3) = $dbh->selectrow_array($query);
use CGI::Cookie;
my $query = new CGI;
my $cookie = $query->cookie(-name=>'oreo',
-value=>"$value1|$value|$value3",
-expires=>'',#when the browser closes
-path=>'https://selected_url/');
print header(-cookie=>$cookie);
Any idea why this will write cookies in Opera and not IE or Firefox?
I got the cookies writing in both Firefox and Opera now. Can't get them in IE though.
Is there something like HTTP Headers for IE.
the path should be a local URI and if I try to enter -domain => 'www.example.com' into the script
-domain=>'http://[hostingcompany].com';
-path=>'/home/users/web/username/public_html/cgi-bin/directory/'); [edited by: tedster at 8:05 pm (utc) on Feb 19, 2013]
[edit reason] hosting specifics [/edit]
-domain => 'www.example.com',
-path => '/',
-domain => '.example.com',
-path => '/store/',