I am using sessions and want to have two different password username protected folders on my site. I am using a registration number on one of the sites and the code checks to see if the registration number is present. If it is it directs to the register page for new members. If not I destroy the session and move them to a different screen.
session_unset();
session_destroy();
My problem is on the other password protected page folder when the user registers it starts a session and if they click my register button on the bottom they automatically get redirected to the first registration screen which I am trying to keep seperate.
Is there a way to destroy the session variable automatically in the first folder if they leave any page so this variable doesn't get passed without ruining the current session the person is in?
In other words I just want to destroy all session variables if they leave a page.
Thanks.