Search the Community
Showing results for tags 'session unset'.
-
Hi all, I've been working with php for awhile, but unfortunately I cannot grasp php session and find a solution to my problem. I have a situation where I set a session value on 1st script and trying to unset it on 2nd script, but unfortunately the session variable will not unset. The session is used for displaying status or error values and after displaying status , session should be unset. On 1st script I use code: session_start(); ... $_SESSION['SESS_STATUS']='This is status msg. '; session_write_close(); header("location: 2nd.php"); exit(); On 2nd script I display session value and unset the session: session_start(); ... if(isset($_SESSION['SESS_STATUS'])) { $status = $_SESSION['SESS_STATUS']; echo $status; unset($_SESSION['SESS_STATUS']); } Msg gets displayed but unfortunately session 'SESS_STATUS' will not unset, so when this page gets refreshed, or navigated trough browser again, the same msg gets displayed again. On every page i use session_start(); so session is continued. I have tried many different ways to unset the session variable but with no luck. Any help or advice is appreciated. Thanks very much !
-
I have a session variable named 'ticktock'. I need to have ticktock set to "" at the top of the last page in the chain. I have this code at the top of the first page: <?php session_name("PassTech"); session_start(); session_destroy(); ?> This is the code I have in the last page: <?php session_name("PassTech"); session_start(); unset($_SESSION['ticktock']); ?> No matter what I've tried, ticktock won't reset. What's going on? tim "If builders built buildings the way that programmers write programs, the first woodpecker to come along would wreck civilization."