63 |
|
|
64 |
confess "unknown store module $module not one of ", dump( $self->possible_stores ) unless $s; |
confess "unknown store module $module not one of ", dump( $self->possible_stores ) unless $s; |
65 |
|
|
66 |
warn "## current store = $s\n" if $self->debug; |
warn "#### current store = $s\n" if $self->debug > 4; |
67 |
|
|
68 |
return $s; |
return $s; |
69 |
} |
} |
84 |
confess "need $k value" unless $v; |
confess "need $k value" unless $v; |
85 |
confess "need state" unless $state; |
confess "need state" unless $state; |
86 |
|
|
87 |
warn "## update_state( $k => $v, ", dump( $state ), " )\n" if $self->debug; |
warn "#### update_state( $k => $v, ", dump( $state ), " )\n" if $self->debug > 4; |
88 |
|
|
89 |
my $uid; |
my $uid; |
90 |
|
|
117 |
confess "need ID or uid" unless $k =~ m/^(ID|uid)$/; |
confess "need ID or uid" unless $k =~ m/^(ID|uid)$/; |
118 |
confess "need $k value" unless $v; |
confess "need $k value" unless $v; |
119 |
|
|
120 |
warn "## get_state( $k => $v )\n" if $self->debug; |
warn "#### get_state( $k => $v )\n" if $self->debug > 4; |
121 |
|
|
122 |
my $uid; |
my $uid; |
123 |
|
|
166 |
|
|
167 |
confess "need ID" unless $ID; |
confess "need ID" unless $ID; |
168 |
|
|
169 |
warn "ID_to_uid",dump( $ID, $state ),$/ if $self->debug; |
warn "#### ID_to_uid",dump( $ID, $state ),$/ if $self->debug > 4; |
170 |
|
|
171 |
$session->{ $ID }->{last_seen} = time(); |
$session->{ $ID }->{last_seen} = time(); |
172 |
|
|
183 |
return $uid; |
return $uid; |
184 |
} else { |
} else { |
185 |
warn "## can't find uid for ID $ID, first seen?\n"; |
warn "## can't find uid for ID $ID, first seen?\n"; |
|
return; |
|
186 |
} |
} |
187 |
|
|
188 |
# TODO: expire sessions longer than 30m |
# TODO: expire sessions longer than 30m |
189 |
|
|
|
warn "current session = ",dump( $session ); |
|
|
|
|
190 |
return; |
return; |
191 |
} |
} |
192 |
|
|