Forum: Ruby on Rails How to check if a user is logged in

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E86310ed21a13387362b1f80f76d8ac9?d=identicon&s=25 Wings (Guest)
on 2007-06-22 10:45
Hi there, I wonder if anyone can help me with this please?

If I have a page that I want to be accessible both prior and post login.
But if the user is logged in, I would want to display the it as a SSL
page, and if user is not logged in, I would display it as normal. I have
used

If session[:user]

SSL required  :index

End

However, this gives an type error, says session[:user] is an array?

What am I doing wrong?

Thanks in advance.
This topic is locked and can not be replied to.