Setting session variables and expiration issue


I’m having some difficulty with using sessions. Basically, I’d like to
be able to store a hash in an action:

def action
session[:details] = {:value => some_hash, :session_path => “/main”}

I’d like to be able to retrieve the hash in another action under the
same “main” controller. I retrieve it by doing the following:

def action2
hash = session[:details]

v1 = hash[:name] # Problem is that this is null

I’m not able to get my values out as I expect. Any help would be
appreciated. Also, when I set :session_path => ‘/main’, does this mean
that the session[:details] will get nulled if a user were to get out of
the “main” controller path?