зеркало из https://github.com/mozilla/pjs.git
Add support for cookies using the new getSessionData() API.
This commit is contained in:
Родитель
582c64044b
Коммит
dd9c968cf4
|
@ -84,6 +84,14 @@ sub splitArguments {
|
|||
# Some other authentication scheme
|
||||
}
|
||||
}
|
||||
# hook in cookies
|
||||
$self->cookies({}); # empty the list of cookies first
|
||||
if (defined($ENV{'HTTP_COOKIE'})) {
|
||||
foreach my $cookie (split(/; /os, $ENV{'HTTP_COOKIE'})) {
|
||||
my($field, $value) = split(/=/os, $cookie);
|
||||
$self->cookies->{$field} = $value;
|
||||
}
|
||||
}
|
||||
# decode the arguments
|
||||
$self->decodeHTTPArguments;
|
||||
}
|
||||
|
@ -154,3 +162,10 @@ sub registerPropertyAsMetaData {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
# cookies
|
||||
sub getSessionData {
|
||||
my $self = shift;
|
||||
my($field) = @_;
|
||||
return $self->cookies->{$field};
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче