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