I’ve created a multiple page form as a wizard. Each step has its own action and its own view that contains a stateful CActiveForm.
On each step when the user presses “Next >>” I read the form data with $_POST, creates the active record instance, saves it and I redirect to the next action (next wizard’s step).
The problem I have is that when the user plays with the back and forward buttons of the browser I get the "Document expired" error message.
I would have thought that the stateful => true in CActiveForm would have avoided this, but it doesn’t.
I’ve done a lot of tests today, and I really don’t understand what’s going on with Yii (or PHP in general) and the back/forward button…
For example I’ve taken the hangman demo into my project. In its original form you can do as much back and forward without ever having a document expired browser error.
In my project the hangman demo does not work with my layout. My layout contains a login module and some logic to generate the menu according to the user role. I’ve commented out every PHP logic and then the hangman demo works. Then I realised that only having this is my layout: if (Yii::app()->user->isGuest == true) breaks the back/forward browser navigation (document expired).
Then in my wizard I’ve got some steps where back/forward work fine and some steps where I get the document expired error… I really can’t see what could be causing those issues…
I am really puzzled. Anyone has some insight with this ?