• 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

Related to "Stop new request on page refresh"

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have some confusion.

Suppose, one page with "login" link on it.

We press the link and (1) GET request sent and server responded with login page.
We fill the form and press login button and (2) POST request sent, and if login will successful then server redirects a page with some user information with (3) GET request.

So, here request history like this according to number (1) GET, (2) POST, (3) GET.
Now, we press "Back" of browser, then why do browser sent (1) GET? why not (2) POST?

Thanks
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The redirect "breaks" the request in two. Therefore for a redirect, refresh uses the GET page and back gets the POST page.

However, I think the page you are describing is using a forward rather than a redirect. That treats the POST/GET as one request. Hence refresh will do the POST/GET again and back gets the original GET.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic