Click here to Skip to main content
Sign Up to vote bad
good
See more: PHP
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 28 Dec '12 - 19:01

Comments
Isuru Nanayakkara - 29 Dec '12 - 6:54
You won't get any help unless you start it first yourself!

2 solutions

unset a session just use
 
unset($_SESSION['session_name']);
  Permalink  
Is this what you want?
...
 
$_SESSION['session1'] = "1";
$_SESSION['session2'] = "2";
$_SESSION['session3'] = "3";
$_SESSION['session4'] = "4";
$_SESSION['session5'] = "5";
 
...
 
function YourFunction()
{
    unset($_SESSION['session3']);
}
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 343
1 Sergey Alexandrovich Kryukov 143
2 Mohammed Hameed 123
3 Santhosh G_ 113
4 Ron Beyer 64
0 Sergey Alexandrovich Kryukov 8,266
1 OriginalGriff 6,516
2 CPallini 3,533
3 Rohan Leuva 2,703
4 Maciej Los 2,234


Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 6 Jan 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid