Invalidate the servlet session if session timeout even when UI automatically updates

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kveerareddy
    New Member
    • Nov 2008
    • 4

    Invalidate the servlet session if session timeout even when UI automatically updates

    Hi experts,

    Technologies: Spring, AJAX, Google web tool kit

    Problem: Ideally when the user stops using a web page then after 30 minutes, if the user is trying to access any ting then the session gets expired.
    But In my case one pages continually refreshes for every 30 seconds, hence not giving scope to session timeout even when the user stops using it.

    Questions:
    Is there any way to stop resetting of time in some specific cases, for example when we automatically refresh the screen then it should not consider that time.
    OR
    Is there any other solution checking the events(Mouse and Keyboard) and manually and then do session.invalid ate(). In this case. I am not able to know a best place to update the Attribute for saving the current time when the user clicks.

    Please let me know your Opinions
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    First of all, why is the page refreshing every 30 seconds? Is it a whole page refresh or Ajax calls?

    Comment

    • kveerareddy
      New Member
      • Nov 2008
      • 4

      #3
      The page i am refering to has some connections and status information which will be checked for every 30 sec and update the GUI with the icons and message information.

      The complete page is refreshed at this time.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        How about converting to Ajax requests, so the whole page is not refreshed? The URL that the request is made to doesn't set the session time so if there's no user interaction and the time has passed, the session is invalidated.

        Comment

        • kveerareddy
          New Member
          • Nov 2008
          • 4

          #5
          -- Presently we use Ajax request
          -- we are not setting the session timeout, it is taking the tomcat session timeout bu default.
          -- How to find out that there is no intaraction from the user and the time expired so that we can invalidate the session?

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            If the Ajax requested page doesn't have any session code, would it work, i.e. you don't start a session in that page, so if requested, it wouldn't register as part of the session? This depends on how your server-side code works.

            Comment

            Working...