Session/Http, rework getCookies logic so that empty hash is returned if there's no

request object.  That way a sessionId gets created back in Session::Var::start.

Session.pm: pass Session::DateTime->new a session object instead of self

Session/DateTime.pm:  Added a space.  Note that this is infinite recursion since
it calls itself.
This commit is contained in:
Colin Kuskie 2006-01-14 18:58:30 +00:00
parent 6dfa55d423
commit 84e20a1a96
3 changed files with 8 additions and 3 deletions

View file

@ -148,7 +148,7 @@ Returns a WebGUI::Session::DateTime object.
sub datetime {
my $self = shift;
if (exists $self->{_datetime}) {
$self->{_datetime} = WebGUI::Session::DateTime->new($self);
$self->{_datetime} = WebGUI::Session::DateTime->new($self->session);
}
return $self->{_datetime};
}

View file

@ -727,7 +727,7 @@ Returns an epoch date for now.
sub time {
my $self = shift;
return$self->session->datetime->time();
return $self->session->datetime->time();
}
#-------------------------------------------------------------------

View file

@ -63,7 +63,12 @@ Retrieves the cookies from the HTTP header and returns a hash reference containi
sub getCookies {
my $self = shift;
return APR::Request::Apache2->handle($self->session->request)->jar();
if ($self->session->request) {
return APR::Request::Apache2->handle($self->session->request)->jar();
}
else {
return {};
}
}