I am currently designing a site that uses PHP4 sessions to keep track of the logged in status of a user. That is working fine.
Here is the part I am having problems with:
The site is meant to be accessed from several different sites and works almost transparently through the use of frames. ie. Each site including my code simply uses frames to create its own header graphics and left column menu and then just uses a right frame that accesses http://location.ofmysite.org.
When a user logs on the variables are POSTed via form and checked against a database. If the login and password are valid, session variables are set to the real name of the user as well as the fact that they are logged in, their preferences, etc. The php code then continues to execute and the site is modified based on the new “logged in” values provided by the session variables. If a user then follows a link to view something on the site and then pushes BACK on their browser they get the message/page:
“Data Missing
This document resulted from a POST operation and has expired from the cache. If you wish you can repost the form data to recreate the document by pressing the
reload button.”
This makes sense since the page was generated AFTER the validation from the previous page’s POST action.
Normally, I deal with this by allowing my validation code to run and then reset the header to the page I desire and allow the php to re-execute (ie. header(location:$phpself)) thus the POST variables will not be required I now follow a link and then push back only once. Since this page is set up in the FRAMES manner of which I was speaking and there is no way of knowing which site it is being displayed in, I can not reset the browser header, because the top and left frames will be lost and the user will probably not have any clue what happened and why only http://location.ofmysite.org is available rather than the site that they THOUGHT they were in.
Does anyone have any solutions to this? If this was not specific enough, left me know and I’ll type some more! thanks in advance.
Adam.