Answer:
See Explanation Below
Explanation:
Follow the steps below.
1. Start Session
2. Assign the session you want to preserve ( $_SESSION['variablex'] ) to a variable
3. Destroy all session (including the one you want, $_SESSION['variablex'])
4. Reassign the contents of the variable you created in (1) above to $_SESSION['variablex'].
The code is as follows (comments explain each line)
<?php
session_start(); // Start session
$variable = $_SESSION['variablex'] ; // assign $_SESSION['variablex'] to $variable
session_destroy(); // Destroy sessions
$_SESSION['variablex'] = $variable; // assign $variable back to $_SESSION['variablex'] to
// You can continue your code (if you have any), here
// End of solution
?>