diff options
author | Yorhel <git@yorhel.nl> | 2011-01-27 10:11:52 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2011-01-27 10:11:52 +0100 |
commit | 08d3dffe2dc6b955f2e10629079d5ae5c32f7183 (patch) | |
tree | 4a2c8f5a2fa52f73b94d4cab610f71ab3234a3c6 /lib/VNDB/Handler | |
parent | 01c4028bfa067546af572de06789cc4121b1ffbc (diff) |
TUWF: Replaced resHeader('Set-Cookie', ..) with resCookie()
Way more convenient. This also fixes several bugs with the previous
commit, since the cookie_prefix wasn't used for *all* cookies. Since it
is now, the 'l10n' cookie now also respects the configured prefix, which
means some people will have to set their default language again.
Configuration changes: 'cookie_domain' option has been removed, the
'cookie_defaults' option of TUWF should now be used.
Diffstat (limited to 'lib/VNDB/Handler')
-rw-r--r-- | lib/VNDB/Handler/Misc.pm | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm index 2e1e0e11..426de785 100644 --- a/lib/VNDB/Handler/Misc.pm +++ b/lib/VNDB/Handler/Misc.pm @@ -354,9 +354,7 @@ sub setlang { if($lang ne $self->{l10n}->language_tag()) { $self->authInfo->{id} ? $self->authPref(l10n => $lang eq $browser ? undef : $lang) - : $self->resHeader('Set-Cookie', sprintf 'l10n=%s; expires=%s; path=/; domain=%s', - $lang, $lang eq $browser ? 'Sat, 01-Jan-2000 00:00:00 GMT' : 'Sat, 01-Jan-2030 00:00:00 GMT', - $self->{cookie_domain}); + : $self->resCookie(l10n => $lang eq $browser ? undef : $lang, expires => time()+31536000); } } @@ -384,7 +382,7 @@ sub iemessage { (my $ref = $self->reqHeader('Referer') || '/') =~ s/^\Q$self->{url}//; $ref = '/' if $ref eq '/we-dont-like-ie'; $self->resRedirect($ref, 'temp'); - $self->resHeader('Set-Cookie', "ie-sucks=1; path=/; domain=$self->{cookie_domain}"); + $self->resCookie('ie_sucks' => 1); return; } |