• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to Handle REFRESH event in Browsers?

 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Ranchers,
My application has a login page, after successful login user can view or navigate to several pages .
My requirement is when ever the user clicks REFRESH button from the BROWSER, Session should expire and needs to show Login Page.
How to handle REFRESH event in browsers? Is it(handling) different for different browsers?
Please help in this regard.
 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your question is not clear to me.

Each session has time out and default value is 30 min. So if you are validating the session on each page, for invalid session, you can throw the user to login page, in this case it has nothing to do with refresh event of browser as such.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you serious? Log someone out if refresh is clicked? Why would you want to do that?
 
M K Rayapudi
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you Manoj and Bear Bibeault for your immediate response.

Bear Bibeault wrote:Are you serious? Log someone out if refresh is clicked? Why would you want to do that?


Yes, I need this functionality, I am working on E-Commerce module, in order to stop multiple submits by the user by REFRESH button, I require this.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Logging off is hardly the appropriate way to handle multiple submits. Would you also chop off your head to cure a headache?

Read through this article and pay particular attention to the P-R-G pattern.
 
M K Rayapudi
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you Bear Bibeault for your immediate response.
I will go through the article you suggested.
 
Rancher
Posts: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is related to the perenial FAQ: How do I disable browser back and forward buttons.

It does have a FAQ entry:http://faq.javaranch.com/java/InterfaceDesignersRule1
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic