Hi all,
I cannot get this to work at all … it never does the redirect.
I have two authentication cookies set … Rails reads thier values fine
if
they exist
If they don’t exist, I want to redirect the user to the login page –
which
is not a rails controller/model …(single sign on location)
I figured I’d add the code to the application_helper … so that I could
reference it in all my views.
module ApplicationHelper
def ifLoggedIn()
useridcookie=cookies[:UserID]
usersessioncookie=cookies[:usersession]
if (!useridcookie)
redirect_to “http://loginpage.html”
end
if (!usersessioncookie)
redirect_to http://loginpage.html
end
end
end
in my view (list.rhtml), I call <% ifLoggedIn() %>
right at the top
Any help much appreciated!
–
Chris