• 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 disable cookies through programming

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
i am making a database application in jsp/servlets which included online accessing and entering the data into tables.I am afraid that once the user submit the values he can go back and if re submits the page then the database will give errors.
I have to put all the checks at the user side itself so is there anyway through which i can show the message that "THE PAGE HAS EXPIRED" whenever the user navigates backwards.
I think i can be done by disabling cookies so that no files are stored in temperory folder.
thanks in advance
himanshu
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This problem has nothing to do with cookies...

Please read the last post in this thread (Avoid submission of form multiple times), that describes the correct way to prevent multiple form submissions.

(N.Pruett - fixed link.)
[ September 23, 2004: Message edited by: Nathan Pruett ]
 
Himanshu Bisht
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks mate!!!

but the solution is not working!!!I tried it but it is still taking you back and you can click the submit button again.
Well i want something like once the page is viewed you caanot go back to the submit page.Is it possible to do it in jsp???

Thanks again
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you can go back and click the submit button again, but the full request should not go through if you're using the "synchronizer token pattern" discussed in the referenced post.

If you really don't want to render the page again, you could change the procedure a bit - set the token in the session in the page before the form page, check for the token in the form page - if it's there show the form and remove the token, else show an error page. You also need to ensure that you turn off caching for the page so the browser makes a new request every time.
reply
    Bookmark Topic Watch Topic
  • New Topic