Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Request objects and authentication redirects

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My application uses DispatchMappingAction objects to handle a variety of user functionality. Each DispatchMappingAction is actually extended from a BaseDispatchMappingAction where in the executeBefore() method, I test the user's ticket and redirect to a login page if necessary.

I'm finding that if the user was in the process of filling out a form and then their ticket expired, the form data is lost after they submit, because they are redirected to the login page and redirects start a new request. What are the general ways to handle this situation? If this is not the optimal way of doing things (unfortunately I didn't write this code so I'm trying to avoid rewriting if possible) what should be the proper way?

Thanks.
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, can you please explain what you mean by ticket? I assume you are referring to a session.

Anyway, if something (a ticket) expires that requires them to login again, why should they be able to submit a form after it (the ticket) is expired?
 
Darien Cheung
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I guess a ticket is a session and it has a timeout value. The authentication is done externally.

Hmm.. you raise a good point. If the session has timed-out, I should probably make them go back to the form and re-enter all the data?
 
Dom Lassy
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Darien Cheung:
Hmm.. you raise a good point. If the session has timed-out, I should probably make them go back to the form and re-enter all the data?



Exactly. I believe that is the common practice. Although sometimes there may be a javascript timer on the front end that warns a user that their session is about to expire and allows them to keep their session alive without reloading the page or losing form data. There are a couple of ways to accomplish this. Post again if you want to know how to implement it.
 
    Bookmark Topic Watch Topic
  • New Topic