Prefix base64 encoded cookie (#597)

This commit is contained in:
Jonatan Kłosko 2021-10-13 23:07:50 +02:00 committed by GitHub
parent 5dea204fc9
commit 06822b6e7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,7 +24,7 @@ defmodule Livebook.Utils do
"""
@spec random_cookie() :: atom()
def random_cookie() do
:crypto.strong_rand_bytes(35) |> Base.encode32(case: :lower) |> String.to_atom()
:"c_#{Base.url_encode64(:crypto.strong_rand_bytes(39))}"
end
@doc """