Forum: Ruby on Rails Session not getting destroyed on Logout

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.
871882425ea678841f280a10b855f25c?d=identicon&s=25 Jack (Guest)
on 2008-12-10 23:34
(Received via mailing list)
Hi,
     I'm trying to destroy session when user clicks logout in
rails....Here is the code:

def logout
    reset_session
    redirect_to
CASClient::Frameworks::Rails::Filter.client.logout_url
(request.referer, url_for (:controller => 'site', :action =>
'myportal'))
end

However, when I click the back button, it shows me the page with all
information. If the session is destroyed, it should not display the
page, right?

What could be the issue?

Appreciate any help!!

Thanks!
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2008-12-10 23:34
(Received via mailing list)
On Dec 10, 10:22 pm, Jack <freephon...@gmail.com> wrote:

> However, when I click the back button, it shows me the page with all
> information. If the session is destroyed, it should not display the
> page, right?
>
> What could be the issue?
>

Your browser's cache

Fred
D188e591eac11021329b8821a5f954c7?d=identicon&s=25 Ar Chron (railsdog)
on 2008-12-10 23:57
The Back button is just a LOCAL browser history navigation command, if I
remember correctly.
871882425ea678841f280a10b855f25c?d=identicon&s=25 Jack (Guest)
on 2008-12-11 02:15
(Received via mailing list)
If I want to redirect the user back to the login page when back is
hit, what code do I need to put in?

Thanks!
D188e591eac11021329b8821a5f954c7?d=identicon&s=25 Ar Chron (railsdog)
on 2008-12-11 05:38
Maybe a before_filter on the controller for your page that checks to see
if the user is logged in, and if not, routes them to the login page?
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2008-12-11 09:30
(Received via mailing list)
On Dec 11, 1:14 am, Jack <freephon...@gmail.com> wrote:
> If I want to redirect the user back to the login page when back is
> hit, what code do I need to put in?
>
The problem you might find is that your server isn't hit at all. The
browser just pulls up its cached copy of the page.

Fred
This topic is locked and can not be replied to.