I thought to store the type of the currently logged in user in session[:user_type]
. The options are: "admin", "end_user", "demo" (may add more user types in the future).
I wonder if it is safe to do that in Rails 3 application.
Can user change somehow the session[:user_type]
from "demo" to "admin" ?
It depends of your session store.
By default use cookies as a session store so by default it's not safe it's pretty easy to change the content of a cookie.
So you could either :
Look in this thread: Rails sessions current practices
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With