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

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Wings (Guest)
on 2007-06-22 12: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

If session[:user]

SSL required  :index


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.