Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

In a page more than 5 session variables had set but i want to unset only single

session variable after a function all..

Help me to do this
Posted
Comments
Isuru Nanayakkara 29-Dec-12 6:54am    
You won't get any help unless you start it first yourself!

Is this what you want?
PHP
...

$_SESSION['session1'] = "1";
$_SESSION['session2'] = "2";
$_SESSION['session3'] = "3";
$_SESSION['session4'] = "4";
$_SESSION['session5'] = "5";

...

function YourFunction()
{
    unset($_SESSION['session3']);
}
 
Share this answer
 
unset a session just use

unset($_SESSION['session_name']);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900