I have:
page1
: submits a formpage2
: validates it and and returns a page
Now when I click the back button, it does not go to page-1 instead it comes with a "Confirm form resubmission" window.
How do I prevent this? Based on this answer, I see this as a recommended approach:
This is a common technique on forums. Form on Page1 posts the data to Page2, Page2 processes the data and does what needs to be done, and then it does a HTTP redirect on itself. This way the last "action" the browser remembers is a simple GET on page2, so the form is not being resubmitted upon F5.
But I'm confused. Where should I append my redirects? My page2
view looks like this:
@app.route('/StartPage',method='POST')
def test():
username = request.forms.get('username')
password = request.forms.get('password')
return template('StartPage',search_string=search_string,\
username=username, \
session_id=ses_id)