fix(persistent_sessions): protect against looking up stale data
This commit is contained in:
parent
329dd4d780
commit
ce49a281ed
|
@ -179,6 +179,10 @@ timestamp_from_conninfo(ConnInfo) ->
|
|||
end.
|
||||
|
||||
lookup(ClientID) when is_binary(ClientID) ->
|
||||
case is_store_enabled() of
|
||||
false ->
|
||||
none;
|
||||
true ->
|
||||
case lookup_session_store(ClientID) of
|
||||
none -> none;
|
||||
{value, #session_store{session = S} = SS} ->
|
||||
|
@ -186,6 +190,7 @@ lookup(ClientID) when is_binary(ClientID) ->
|
|||
expired -> {expired, S};
|
||||
persistent -> {persistent, S}
|
||||
end
|
||||
end
|
||||
end.
|
||||
|
||||
-spec discard_if_present(binary()) -> 'ok'.
|
||||
|
|
Loading…
Reference in New Issue