Volatil3
Volatil3

Reputation: 14978

Unable to store and access Session Variables in Rails 4

I am trying to store session simply by doing session[:user_id] = 1. When I access it in next line by doing puts(session) it prints <ActionController::RequestForgeryProtection::ProtectionMethods::NullSession::NullSessionHash:0x0000010433dda8>

I m also not able to fetch session[:user_id] in other pages.

Upvotes: 0

Views: 250

Answers (1)

Maxim
Maxim

Reputation: 9961

You are using NullStore. Just configure other store (file, memcached, etc.)

Upvotes: 1

Related Questions