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

Session variables are lost, disappear from page to page

My Server Enivronment:

MS Windows Server 2003
Standard Edition, Service Pack 1
(running as a VM on a Intel Xeon server)

IIS running on Port 80
Apache 2.0.63 running on port 8080
PHP 5.2.5
So I have a script that selects a bunch of records from a database,
each record displayed with a checkbox. I have a drop down menu that
says 'edit records' and 'delete records'. When the user selects 'edit
records' the values of the checkboxes are stored in a session array
and the user is redirected to another page to edit the records.

This part of the application works fine.

When the user selects 'delete records' the same things happens except
their directed to a different page. But when the user gets there, for
some reason, the data in the session array is gone.

I tried this script on my shared hosting (running Linux) and the
script worked fine.

I tried to use a javascript redirect instead of header() because I saw
that there was a problem with session variables using it back in PHP4,
but that didn't work.

I tried putting the 'delete recrods' code in the same page as the drop
down menu form, and it worked fine. So it's definitely an issue going
from page to page.

But the strangest thing about this, is that the session variables
aren't lost when I try to edit the records, only when I try to delete
records. In fact, another strange thing about this is that this script
worked fine for a while at first, then all of a sudden it stopped
working, like I had changed the code, but I hadn't.

I think it's a PHP bug, but PHP support won't acknowledge it as a bug,
and I can't change the server environment.
Mar 6 '08 #1
3 2329
Saint wrote:
My Server Enivronment:

MS Windows Server 2003
Standard Edition, Service Pack 1
(running as a VM on a Intel Xeon server)

IIS running on Port 80
Apache 2.0.63 running on port 8080
PHP 5.2.5
So I have a script that selects a bunch of records from a database,
each record displayed with a checkbox. I have a drop down menu that
says 'edit records' and 'delete records'. When the user selects 'edit
records' the values of the checkboxes are stored in a session array
and the user is redirected to another page to edit the records.

This part of the application works fine.

When the user selects 'delete records' the same things happens except
their directed to a different page. But when the user gets there, for
some reason, the data in the session array is gone.

I tried this script on my shared hosting (running Linux) and the
script worked fine.

I tried to use a javascript redirect instead of header() because I saw
that there was a problem with session variables using it back in PHP4,
but that didn't work.

I tried putting the 'delete recrods' code in the same page as the drop
down menu form, and it worked fine. So it's definitely an issue going
from page to page.

But the strangest thing about this, is that the session variables
aren't lost when I try to edit the records, only when I try to delete
records. In fact, another strange thing about this is that this script
worked fine for a while at first, then all of a sudden it stopped
working, like I had changed the code, but I hadn't.

I think it's a PHP bug, but PHP support won't acknowledge it as a bug,
and I can't change the server environment.
I doubt it's a PHP but. But you haven't posted your code, so we have no
idea what's happening.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Mar 6 '08 #2
In article <21**********************************@60g2000hsy.g ooglegroups.com>,
Saint <ia*******@gmail.comwrote:
>My Server Enivronment:

MS Windows Server 2003
Standard Edition, Service Pack 1
(running as a VM on a Intel Xeon server)

IIS running on Port 80
Apache 2.0.63 running on port 8080
PHP 5.2.5

[snip]

I tried this script on my shared hosting (running Linux) and the
script worked fine.
OK. Nothing wrong with your code or PHP, then.
>But the strangest thing about this, is that the session variables
aren't lost when I try to edit the records, only when I try to delete
records. In fact, another strange thing about this is that this script
worked fine for a while at first, then all of a sudden it stopped
working, like I had changed the code, but I hadn't.

I think it's a PHP bug, but PHP support won't acknowledge it as a bug,
and I can't change the server environment.
Sounds to me like a server bug more than a PHP bug, especially since
it works fine under Linux.

I don't know if it will work, but it helped me to do the following at
the start of my code:

session_save_path($my_session_path);
session_name('login_settings'); // or any other name you want
session_start();
if (session_id() == 'deleted') session_regenerate_id(true);

Mr. Stuckle may come along and argue that the above isn't necessary,
but that isn't true for everyone's case.

-A
Mar 6 '08 #3
Greetings, Saint.
In reply to Your message dated Friday, March 7, 2008, 23:11:19,
I restarted Apache when I turned error reporting on and it started
working again.
I guess the world will never know?
I think there may be some issues with Your browser.
And please, don't top-post.
--
Sincerely Yours, AnrDaemon <an*******@freemail.ru>

Mar 8 '08 #4

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

Similar topics

9
by: Pack Fan | last post by:
I've noticed that session variables will persist on Mac IE even after all browser windows have been closed. One must quit the program to clear the session variables. This presents a security risk...
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...
13
by: Alexander Widera | last post by:
hi, who has seen the follow problem or could help please? i visit a page .... i read a sesssion-var . ... everythink works...... i visit the page again..... error ... the sessionvar is null .... i...
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...
2
by: Tomas Martinez | last post by:
Hi, Well, my problem is so simple as it says in the subjet but very frustrating also. I have a project and it is losing the session variables with each postback, so I downloaded from the web a...
5
by: Simon | last post by:
Hi all, We have a small problem. We are running an ASP.NET1.1 application, using IIS6 on server2003, no web farm, on a single server, using in-proc session state, only using one worker...
4
by: Not Me | last post by:
Hi, I have a set of pages that use forms authentication for access. There are times when one of the session objects I'm using appears to disappear. The session is not timing out, however. (if...
0
by: Aarchaic | last post by:
Hello i have problem my session variables seem to disapear as i go along i've created this code to ilustrate whats happening First off i just post 3 detials like a name a age and a favourite...
22
by: K. A. | last post by:
I have two servers at work, 'A' for testing and development, and server 'B' for production. On server A, I wrote a PHP test code to login users then direct them to a personalized page. This is...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.