When the user accesses the details page of the property on my site, I need to store the broker's email in a session, and when he sends the proposal form, the broker's email is sent to the file responsible for triggering email in input hidden, I retrieve his email in the email.php file and is sent the proposal straight to him through phpmailer.
Ex: Accessing the property 3174, I will store the email of the broker x responsible for this property, if access to another property destroys the previous session and creates a new one with the email of the broker of the current property.
//Aqui eu crio a session['corretor']
if(!isset($_SESSION['corretor'])){
echo $_SESSION['corretor']=$results['email'];
}
How do I make sure that every time a different property is accessed, the current session is destroyed and a new one is created by storing the email of the broker responsible for the property?