Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6245527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:31:21+00:00 2026-05-24T12:31:21+00:00

I need some help dealing with timeouts in a Grails app. Context: In my

  • 0

I need some help dealing with timeouts in a Grails app.

Context: In my Grails application I have sensitive information being displayed. Obviously this means that someone cannot stay logged in, and if they forget to log out I need to time them out. What I have implemented now is a system like this:

-When the person logs in successfully, a session variable isValid is set to true.

-In all my controllers if a method is called that can render or redirect to a gsp, I check that value. If at any time isValid is null, they are immediately redirected to an error page.

-Each gsp has a jquery timeout function that redirects the user to a timeout error page if they time out and sets isValid to false (which should theoretically stop them from using the app anyways).

The redirects all work fine. The problem I am having is that when a user times out, they can still use the back button to return to a cached version of the last page they were on. Obviously this defeats the purpose of timing out.

Question: Does anyone know how I can prevent a user from leaving the timeout page or guarantee that once timed out they will always be redirected to the timeout page?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:31:23+00:00Added an answer on May 24, 2026 at 12:31 pm

    The redirects all work fine. The problem I am having is that when a user times out, they can still use the back button to return to a cached version of the last page they were on. Obviously this defeats the purpose of timing out.

    Why not add an AJAX request back to your app on page load (which should be fired when a user presses the back button in the browser) that verifies the session is still valid and if not redirects the user to the timeout page? Should be simple enough.

    Also, if the information is sensitive make sure you are setting the cache / content expire related HTTP headers to let the browser know it should not cache the page(s). The draw back here is that some browsers don’t fully respect these settings.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help dealing with three Threads in Android One thread is the
Need some help about with Memcache. I have created a class and want to
Need some help, please. I have a line of horizontal thumbnails loaded as ONE
Need some help to solve this. I have a gridview and inside the gridview
Need some help from javascript gurus. I have one page where http://www.google.com/finance/converter is embedded
I need some help from the shell-script gurus out there. I have a .txt
Hi, ive been dealing with this for some time now and need your help.
Need some help. I have a table with some columns..like name , phone etc...
Need some help ! I have a ListActivity...on itch row i have 4 textVIew...
Need some help with extracting 2 pieces of information from the following string: viewed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.