instance method real_csrf_token

Ruby on Rails edge

Since v5.2.8.1 Private — implementation detail, not part of the public API

Available in: v5.2.8.1 v6.0.6.1 v6.1.7.10 v7.0.10 v7.1.6 v7.2.4 v8.0.5.1 v8.1.4 edge

Signature

real_csrf_token(_session = nil)

No documentation comment.

Parameters

_session opt = nil
Source
# File actionpack/lib/action_controller/metal/request_forgery_protection.rb, line 810
      def real_csrf_token(_session = nil) # :doc:
        csrf_token = request.env.fetch(CSRF_TOKEN) do
          request.env[CSRF_TOKEN] = csrf_token_storage_strategy.fetch(request) || generate_csrf_token
        end

        # Decoded once per token rather than once per read: a page asks for
        # the real token once per form it renders.
        if @_real_csrf_token_source == csrf_token
          @_real_csrf_token
        else
          @_real_csrf_token_source = csrf_token
          @_real_csrf_token = decode_csrf_token(csrf_token)
        end
      end

Defined in actionpack/lib/action_controller/metal/request_forgery_protection.rb line 810 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionController::RequestForgeryProtection

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close