Forum Moderators: open
Here's the problem. When a user logs out, the cookie is removed, but if the user were to use there back button on their
browser, they would fall on a page that is looking for a cookie but not finding one, hence displaying the error message.
How can I solve this?
Every page that requires a cookie should first check for one, if it's not -present then redirect to a login page (or error page, or whatever's appropriate). In some cases it may be necessary to first validate the cookie too.
The golden rule is not to assume the data the client is sending can be incorrect (even though you can't recreate it in your testbed). Check and verify as much as you can and handle the exceptions appropriately.
Most people now rely on client-side JavaScript to validate data entry (is it a date/number/e-mail address etc), but almost everything else you should check.
The golden rule is not to assume the data the client is sending can be incorrect
Most people now rely on client-side JavaScript to validate data entry (is it a date/number/e-mail address etc), but almost everything else you should check.
"Most people now rely on client-side JavaScript to validate data entry, but you should still check absolutely everything server-side, too."
Rewboss is right, you should check everything. In my experience though this is rarely the case (though my experience is nearly all intranet applications where JavaScript is a cert). If you're on the www with open access - definitely check everything.