473,396 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

clearing out all $_SESSOIN variables?

Hello,
In a particular session, I set a bunch of $_SESSION vars. Is
there any way of erasing/purging all of them in one fell swoop or must
I iterate through each one or even list them out ...

$_SESSION["a"] = "";
$_SESSION["b"] = "";

..... etc.

I'm using PHP 4. Thanks for your help, - Dave
Jul 17 '05 #1
4 1439
In article <9f**************************@posting.google.com >,
la***********@zipmail.com (D. Alvarado) wrote:
Hello,
In a particular session, I set a bunch of $_SESSION vars. Is
there any way of erasing/purging all of them in one fell swoop or must
I iterate through each one or even list them out ...

$_SESSION["a"] = "";
$_SESSION["b"] = "";

.... etc.

I'm using PHP 4. Thanks for your help, - Dave


Why do you want to do that?

--
DeeDee, don't press that button! DeeDee! NO! Dee...

Jul 17 '05 #2
D. Alvarado wrote:
Hello,
In a particular session, I set a bunch of $_SESSION vars. Is
there any way of erasing/purging all of them in one fell swoop or must
I iterate through each one or even list them out ...

$_SESSION["a"] = "";
$_SESSION["b"] = "";

.... etc.

I'm using PHP 4. Thanks for your help, - Dave


$_SESSION = Array ();
HTH
Pjotr
Jul 17 '05 #3
Pjotr Wedersteers wrote:
D. Alvarado wrote:
Hello,
In a particular session, I set a bunch of $_SESSION vars. Is
there any way of erasing/purging all of them in one fell swoop or
must I iterate through each one or even list them out ...

$_SESSION["a"] = "";
$_SESSION["b"] = "";

.... etc.

I'm using PHP 4. Thanks for your help, - Dave


$_SESSION = Array ();
HTH
Pjotr


Forgot: or use Session_unset ()
Jul 17 '05 #4
"Pjotr Wedersteers" <pj***@wedersteers.com> wrote in news:417a0a8d$0
$7*************@news.xs4all.nl:
Pjotr Wedersteers wrote:
D. Alvarado wrote:
Hello,
In a particular session, I set a bunch of $_SESSION vars. Is
there any way of erasing/purging all of them in one fell swoop or
must I iterate through each one or even list them out ...

$_SESSION["a"] = "";
$_SESSION["b"] = "";

.... etc.

I'm using PHP 4. Thanks for your help, - Dave


$_SESSION = Array ();
HTH
Pjotr


Forgot: or use Session_unset ()


or use both? I think the manual uses that as an example.
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: lallous | last post by:
Hello, Given: class X { int x, y; // and many many more.... X() { memset((void*)this, 0, sizeof(X));
2
by: Andrew Poulos | last post by:
If I'm using DOM methods to dynamically create elements in a page is it necessary for me to clear whatever variables I used to create the elements when the page unloads? I'm reading bits and...
12
by: Hans B | last post by:
Please bear with me if I ask silly questions....I am a somewhat newbie to the C language.... If I had: struct test1_{ unsigned char mycount1; unsigned short mycount2; unsigned short...
1
by: Tyros | last post by:
I'm new to C# and I'm dynamically creating a table control that contains a text control inside one of the cells. I load the values of each text field with an SQL call. The form is simple and I'm...
0
by: PD | last post by:
I am trying to stream out a PDF file via the response object and when I execute the code it always brings up the first document that I pulled up.Even when I step through the code, I can see the new...
2
by: Leszek Gruszka | last post by:
My question is - how to clear variable in code? I don't want to declare different variables for all my functions... I've got 20 functions, that are running in application everytime i run it. In...
2
by: Dan | last post by:
In C, it's usually necessary to clear the memory in structures before passing them to certain WinAPI functions. How would one do that in VB.NET?
4
by: Amy | last post by:
I'm having a problem with clearing my session variables. I'm using session variables to pass data from a web form to a pdf generator. The problem comes in when a user goes back to the original...
7
by: Pam Poulos | last post by:
I have a form where users input some dates, these dates are then written to date variables. I need to clear out the date variables with either an empty string or a null value. Currently, I am...
6
by: =?Utf-8?B?R2Vv?= | last post by:
Hi, I use lots of sessions. I want to clear the unwanted sessions when I leave a page. I cant use ViewState as it will slow down the pages. Could some one help me on this?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.