i am working on online quiz site. In which the user can select the option and as per the answer the marks are added or not if answer is incorrect. I store the total marks, correct answer & wrong answer in session variable
$SESSION['marks'];
$SESSION['wrong_ans'];
$_SESSION['correct_ans'];
These session variable are carry forward to the result page & displayed on the result page. On the result page i unset all three session variable so that if the user appear for another exam in the same login session then his marks are calculated freshly. In this case it works properly but if the user doesn't reach to the result page & exited in the middle of exam & started new exam then his previos marks are carry forward that i dont want. If i unset varible before result page then everytime the marks are unset & it doesnt gives the total of marks
please tell me solution