Skip to content
Discussion options

You must be logged in to vote

Wrote helper for change Wallaby session based on desired data, I've try to generate a session cookie without a real request by manually simulating parts of the Plug pipeline. It forces the execution of any before_send hooks to finalize the response (which includes generating the cookie). Current approach is a bit closer to actual cookie generation than just put_resp_cookie

put_session.ex

 @spec put_session(Wallaby.Session.t(), atom(), term()) :: Wallaby.Session.t()
  def put_session(session, key, value) do
    endpoint_opts = Application.get_env(:runa, AppWeb.Endpoint)
    secret_key_base = Keyword.fetch!(endpoint_opts, :secret_key_base)
    session_opts = Keyword.fetch!(endpoint_opts, :s…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ravecat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant