Reputation: 514
I have 5 Session
in my script. I want to destroy
two from them.
<?php
session_start();
$_SESSION['productid'] = "123";
$_SESSION['imglink'] = "x.png";
$_SESSION['oldprize'] = "120";
$_SESSION['spacialprize'] = "100"
$_SESSION['productname'] = "AC";
?>
Upvotes: 0
Views: 5169
Reputation: 1
Use the following
unset($_SESSION['productname']);
unset($_SESSION['productname']);
After this, your session will be deleted.
Upvotes: 0
Reputation: 825
unset($_SESSION['productname']); unset($_SESSION['productname']);
"session_destroy():" will destroy the whole session
Upvotes: 1
Reputation: 1047
This is only a Session Value:
$_SESSION['productname'] = "AC";
If you want to "destroy" this, you can use following function:
unset($_SESSION['productname']);
If you use "session_unset();" and "session_destroy();" your whole session values are destroyed, and you have to restart a session.
Upvotes: 1