Method: ActionController::RequestForgeryProtection::CookieStore#store

Defined in:
actionpack/lib/action_controller/metal/request_forgery_protection.rb

#store(request, csrf_token) ⇒ Object



348
349
350
351
352
353
354
355
356
357
# File 'actionpack/lib/action_controller/metal/request_forgery_protection.rb', line 348

def store(request, csrf_token)
  request.cookie_jar.encrypted.permanent[@cookie_name] = {
    value: {
      token: csrf_token,
      session_id: request.session.id,
    }.to_json,
    httponly: true,
    same_site: :lax,
  }
end