Session variable difficulty in Ruby on Rails

Hi

My application has many users. If I log in as “admin”, then someone else
logs in as “fred”, when I save something then it is updated by “Fred”
not “admin”. i.e. The session variable used is the last one registered.

Cookies might be a way to solve this or I could store the session in the
database…What do you think is the best way to overcome this in RoR
and how?

Any advice would be really appreciated.

Regards

Darren

Darren E. wrote:

Hi

My application has many users. If I log in as “admin”, then someone else
logs in as “fred”, when I save something then it is updated by “Fred”
not “admin”. i.e. The session variable used is the last one registered.

Cookies might be a way to solve this or I could store the session in the
database…What do you think is the best way to overcome this in RoR
and how?

Any advice would be really appreciated.

Regards

Darren

Darren,
The whole point of the session stuff is to make it easy for your app to
“keep people separate and remember what each one is up to”. I think
there must be something wrong with how you’re using the session
variables. Can you show us some code?

jp

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs