Skip to content

Commit c395daa

Browse files
committed
fix: warn when session backend lacks rotate_session/2
The fallback path deletes the old session but cannot migrate data since the behaviour has no get-all-values callback. Add a warning log so this is visible.
1 parent 404a145 commit c395daa

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/nova_session.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ rotate(Req) ->
130130
true ->
131131
Mod:rotate_session(OldSessionId, NewSessionId);
132132
false ->
133+
?LOG_WARNING(#{msg => <<"Session backend does not implement rotate_session/2, data will not be migrated">>,
134+
module => Mod}),
133135
Mod:delete_value(OldSessionId)
134136
end,
135137
Req1 = cowboy_req:set_resp_cookie(<<"session_id">>, NewSessionId, Req,

0 commit comments

Comments
 (0)