473,385 Members | 1,445 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,385 software developers and data experts.

Session Variables Wierdo

Here is a nutty one:

I have session variables in my page. Take two of them:
$_SESSION['currentID'] and $_SESSION['firstName'].

Now $_SESSION['currentID'] is set before the page and
$_SESSION['firstName'].is set on entry to the page. The
$_SESSION['firstName'].displays properly in the following html code, so I
know it gets set.

When I click on a button named editFoo, I do a

if (!isset($_POST['editFoo']) {
header{"Location: blah");
}

What happens is that the $_SESSION['currentID'] is still there but the
$_SESSION['firstName'].is empty.

I checked the sending page by putting an echo before the if statement (which
is the last before going into display the html and after the
$_SESSION['firstName'].has been set. Both variables display perfectly.
When I click on the editFoo button, only the $_SESSION['currentID'] displays
properly and the other displays empty.

I have @session_start() in all.

Any clues?

Shelly
Feb 24 '06 #1
1 1016
As ususal, or at least as so often happens, right after I am totally
frustrated and post to the group, a lightbulb goes on and I solve the
problem.

Why did this happen]? Because I had a check if $_POST['currentID'] was set
and if not, then I would clear all the OTHER session variables. Pilot
error. All I had to do was think about how the currentID could be treated
differently than the others.

Thanks anyway.

"Sheldon Glickler" <sh*******@bellsouth.net> wrote in message
news:kE******************@bignews5.bellsouth.net.. .
Here is a nutty one:

I have session variables in my page. Take two of them:
$_SESSION['currentID'] and $_SESSION['firstName'].

Now $_SESSION['currentID'] is set before the page and
$_SESSION['firstName'].is set on entry to the page. The
$_SESSION['firstName'].displays properly in the following html code, so I
know it gets set.

When I click on a button named editFoo, I do a

if (!isset($_POST['editFoo']) {
header{"Location: blah");
}

What happens is that the $_SESSION['currentID'] is still there but the
$_SESSION['firstName'].is empty.

I checked the sending page by putting an echo before the if statement
(which is the last before going into display the html and after the
$_SESSION['firstName'].has been set. Both variables display perfectly.
When I click on the editFoo button, only the $_SESSION['currentID']
displays properly and the other displays empty.

I have @session_start() in all.

Any clues?

Shelly

Feb 24 '06 #2

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

Similar topics

6
by: Al Jones | last post by:
This is a repost form the vbscript newgroup - if this isn't the appropriate group would you point me toward one that is. Basically, I seem to be losing session data part way though preparing an...
6
by: Lina Manjarres | last post by:
Hello, I have a session variable in a login page. Then I go to a form page where I uses the ProfileID and the UserID. Then I go to a result page where I would like to use the UserID as a filter,...
4
by: PJ | last post by:
A particular page seems to be having issues with correctly setting Session variables. I am setting a couple of session variables on the Page_Unload event. While stepping through code, the...
31
by: Harry Simpson | last post by:
I've come from the old ASP camp where session variables were not used. When i started using ASP.NET in 2001, I started using them again because it was ok from what I'd read. I've been merrily...
10
by: tshad | last post by:
I have been using the default session state (InProc) and have found that I have been loosing my information after a period of time (normally 20 minutes). Is there anyway to find out how much...
3
by: Alan Wang | last post by:
Hi there, Once my application gets complicated and complicated. I found it's really hard to keep track of Session value I am using in my asp.net application. I am just wondering if anyone have...
3
by: Phillip N Rounds | last post by:
I'm writing a user control which has two states: Active & InActive. I additionally am required that there to be only one active control per page, and all logic has to be contained within the...
18
by: BillE | last post by:
When a user opens a new IE browser window using File-New-Window the integrity of an application which relies on session state is COMPLETELY undermined. Anyone who overlooks the fact that...
26
by: BillE | last post by:
Some ASP.NET applications use Session Variables extensively to maintain state. These should be re-written to use viewstate, hidden fields, querystring, etc. instead. This is because if a user...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.