Page 1 of 1

cannot destroy session

Posted: Thu Oct 02, 2003 5:34 pm
by Derek_24ca
Hello. I have this problem. Was wondering if anyone out there can give me some ideas to fix it.

I have a registration page which is the main window. After the user fills it out and clicks on a submit button, a popup window is created. The values that was filled on the form is sent to the popup window. The session gets started on the popup window. It is a quiz. As user goes from one question to the next, the popup window, popup.php, is being submitted, and $question_val which is contained in the popup gets incremented by one in order to go to the next question upon submission. My problem is that if the user is cut of at question 6 for example, say the popup window gets shutdown, he goes to the registration page, refills it, and returns to the test again. But, he is back on question7, not question 1 where he should be. It works fine if the main window, the registration page was shutdown and re-opened again. But, I would like the main window to remain open, in case if he wishes to do another test after he completes the previous one, and destroy the session if the popup window is closed.

How do I destroy the session if the main window remains open? Tried shuting down the main window if popup is closed, but everytime the form is submitted to go to the next question, it costs problems. Thanks alot.

Posted: Thu Oct 02, 2003 7:32 pm
by volka
reset the session data.
The user fails at $_SESSION['question']==6? All right then he/she/it is at $_SESSION['question']=0 again ;)

Posted: Thu Oct 02, 2003 9:04 pm
by Derek_24ca
OK, thanks. But, how do I know if the user has failed on a question? I can't put that string of code in my registration page, because if I do, the session variables defined on the test page won't work properly. Thanks.

Posted: Thu Oct 02, 2003 9:07 pm
by volka
thought it was one session we're talking about.
Then it doesn't matter which page handles them, session is session ;)

You can find out more about session e.g. at http://www.zend.com/zend/tut/session.php

Posted: Fri Oct 03, 2003 10:45 am
by Derek_24ca
OK, I'll take a look at that link you provided. Thanks.