ActionDispatch::Request::Session keeps giving the following error: *** NoMethodError Exception: undefined method `key?' for nil:NilClass

146 views Asked by At

I am trying to set some attributes in a before_action of a store with multi step checkout behaviour.

All the before_action does is set some attributes for session

session[:checkout_attributes] ||= {}

but after the first step I keep getting the following error.

<ActionDispatch::Request::Session:0x11f80 not yet loaded> *** NoMethodError Exception: undefined method key?' for nil:NilClass`

Any suggestions would be appreciated.

I tried force loading the session using session.send(:load!) but it did not help, it just gave the same error.

0

There are 0 answers