Correct code of updateSession
This commit is contained in:
parent
42e19787f1
commit
52e8221608
@ -781,8 +781,17 @@ sub updateSession {
|
|||||||
my ( $self, $infos, $id ) = splice @_;
|
my ( $self, $infos, $id ) = splice @_;
|
||||||
my %cookies = fetch CGI::Cookie;
|
my %cookies = fetch CGI::Cookie;
|
||||||
|
|
||||||
|
# Return if no infos to update
|
||||||
|
return undef unless ( ref $infos eq 'HASH' and %$infos );
|
||||||
|
|
||||||
# Update sessionInfo datas
|
# Update sessionInfo datas
|
||||||
$self->{sessionInfo}->{$_} = $infos->{$_} unless ($id);
|
if ($id) {
|
||||||
|
foreach ( keys %$infos ) {
|
||||||
|
$self->lmLog( "Update sessionInfo $_ with " . $infos->{$_},
|
||||||
|
'debug' );
|
||||||
|
$self->{sessionInfo}->{$_} = $infos->{$_};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Recover session ID unless given
|
# Recover session ID unless given
|
||||||
$id ||= $self->{id};
|
$id ||= $self->{id};
|
||||||
@ -794,6 +803,7 @@ sub updateSession {
|
|||||||
|
|
||||||
# Store/update session values
|
# Store/update session values
|
||||||
foreach ( keys %$infos ) {
|
foreach ( keys %$infos ) {
|
||||||
|
$self->lmLog( "Update session $_ with " . $infos->{$_}, 'debug' );
|
||||||
$h->{$_} = $infos->{$_};
|
$h->{$_} = $infos->{$_};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user