Re: Accessing session variables

rosoft2001
2006-11-15T03:19:12Z

session[:id] = 3

a = session[:id]


Zon
http://www.ZONator.com


-- -- wrote:
> I need to reference the user ID variable in a view and I am uncertain of
> the proper syntax. The user ID is stored in a session variable. What is
> the proper syntax to use?
>
> (Also, are there any useful references for ruby syntax online? I
can''t
> seem to find any good ones.)
>
> For reference, here is a dump of the session info:
>
> --- !ruby/object:CGI::Session
> data: &id001
>   user: !ruby/object:User
>     attributes:
>       id: "1"
>       password: c90121c2fbb54ec2133fb0c868dc1b04e354fe66
>       login: jsmith
>   flash: !map:ActionController::Flash::FlashHash {}
>
> --
> Posted via http://www.ruby-forum.com/.