Call to session[:somevalue] returns the error "Symbol as arr

I hope you can help me with this

In a controller I make a call to session[:user_id] in order to retrieve
the value that has previously been assigned to the session object by a
login method.

The result is the error “Symbol as array index”, so rails for some
reason just thinks session is any other array.

I have tried prefixing the call with @request so that it goes:

somevariable = @request.session[:user_id]

But this just gives an error saying that @request is not initialised,
making the call equal to nil.session

Thanks in advance!