Skip to content

Commit

Permalink
Use a CSRNG
Browse files Browse the repository at this point in the history
Fixes #1.
  • Loading branch information
rlipscombe committed Jan 28, 2023
1 parent 247c2c4 commit ac49602
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cowboy2_session_stream_h.erl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ init_session_3(_, _, Req) ->
init_new_session(Req0) ->
NewSessionId =
base64url:encode(
rand:bytes(?SESSION_ID_LEN_BYTES)),
crypto:strong_rand_bytes(?SESSION_ID_LEN_BYTES)),
Req = Req0#{session_id => NewSessionId, session => #{}},
% TODO: HttpOnly, Secure, etc.
CookieOpts = #{},
Expand Down

0 comments on commit ac49602

Please sign in to comment.