Saving the session identifier as a cookie with a long expiration time will solve the problem, but introduce a new problem: on public or shared computers, users will have to explicitly log out (that is, destroy the session), otherwise everyone who accesses the site after they log out will continue his session.
Another solution is to link the "exam sessions" to the user, save them in the database and continue the session if the user with the waiting exam is registered. Obviously, this requires a bit of coding :-)
Icopo source share