This will fail if you try putting a hash into session[:user] like you
did above, because you’d then need to do session[:user][‘login’]
rather than session[:user].login.
redirect_to :controller => ‘login’
You probably want to put a return in here to make sure the rest of
the method doesn’t get executed.
So, tying this all together and cleaning it up, you probably really
want something like: