I want to destroy one session on different page. So basically when I redirect visitor to (for example “success.php”) the session will be destroyed no matter on time left.
if(isset($_SESSION["log"])) {
$from_date = $_SESSION["log"];
$minute = 30 - round(abs($date - $from_date) / 60,2);
$ips = explode("/", $ip_sessions);
if(in_array($ip, $ips) && $minute > 0 && $minute < 30) {
$valid = true;
} else {
session_destroy();
}
so I just want to have another page “success.php” with other content, but visit of this page will destroy the session from above that is on “index.php”.
Can anyone help me to write the code to destroy this session on new page?
http://php.net/manual/en/function.session-destroy.php
Is this all that you need or am I totaly misunderstanding your question here?