- Added an option to override the session cookie domain.
- fix: Search results not showing synopses - fix: Redirects get displayed inside page layouts as '0' - fix: Mysterious "0" Appearing When Admin Is Off - fix: Deletion of Products
This commit is contained in:
parent
6a88fa5ca2
commit
c956ba3969
9 changed files with 36 additions and 7 deletions
|
|
@ -242,7 +242,7 @@ sub setCacheControl {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setCookie ( name, value [ , timeToLive ] )
|
||||
=head2 setCookie ( name, value [ , timeToLive, domain ] )
|
||||
|
||||
Sends a cookie to the browser.
|
||||
|
||||
|
|
@ -258,6 +258,10 @@ The value to set.
|
|||
|
||||
The time that the cookie should remain in the browser. Defaults to "+10y" (10 years from now).
|
||||
|
||||
=head3 domain
|
||||
|
||||
Explicitly set the domain for this cookie.
|
||||
|
||||
=cut
|
||||
|
||||
sub setCookie {
|
||||
|
|
@ -265,6 +269,7 @@ sub setCookie {
|
|||
my $name = shift;
|
||||
my $value = shift;
|
||||
my $ttl = shift;
|
||||
my $domain = shift;
|
||||
$ttl = (defined $ttl ? $ttl : '+10y');
|
||||
if ($self->session->request) {
|
||||
require Apache2::Cookie;
|
||||
|
|
@ -274,6 +279,7 @@ sub setCookie {
|
|||
-expires=>$ttl,
|
||||
-path=>'/'
|
||||
);
|
||||
$cookie->domain($domain) if ($domain);
|
||||
$cookie->bake($self->session->request);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue