473,889 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

$_SESSION / $HTTP_SESSION_V ARS behaviour

I've been trying to integrate some PHP pages of my own with some
existing code. The details of this are for the support forums for that
code (where I have been asking questions), but I wonder if someone here
can enlighten me as to why the problematic code is having the effect it is.

For reasons I don't know, if the PHP version is 5 or greater,
register_long_a rrays is false and $_SESSION exists, the following
statement is executed:

$HTTP_SESSION_V ARS = $_SESSION;

This line is stopping any subsequent changes to the $_SESSION variable
from being stored in the session file on the server - changes can be
made, but are all lost at the end of the page processing and the value
reverts to whatever it was before the script was executed.

Is this behaviour by design? Why does it happen? Is there a standard
reason why anyone would include a statement like this (security?)?

I'm seeing this behaviour on PHP 5.1.3 / Win 2003 sp1 / IIS 6 and on PHP
5.1.6 / Win XP sp2 / Apache 2.

Thanks for any help!

Regards,
Mike
Nov 1 '06
12 41226
Pedro Graca wrote:
Michael Windsor wrote:
[...]
>session
[...]
>Directive Local Value Master Value
[...]
>session.save_p ath no value no value
[...]

I believe `session.save_p ath` is your problem.
If there's no value for it, PHP will use "/tmp". Do you have a "C:\tmp"
directory on your disk?

Try changing php.ini and specify an existing directory for the
session.save_pa th entry, or create a "C:\tmp" directory.

Or do it within a test script first:
....[snip]...
>
I looked at this previously - I was examining the session files to see
if I could determine the problem. Session information is being stored in
C:\WINDOWS\Temp already; presumably PHP is defaulting to the system temp
path in the absence of a defined value.

Anyway, I'm sorry to report that adding the session_save_pa th() call
doesn't make any difference to the running of the script: the value is
still only incremented when $_SESSION is not assigned to another variable.

Just to make sure, I changed php.ini to specify a session path, but
again, it didn't make any difference, with or without the
session_save_pa th() call.

Are you running PHP on Windows? I'm wondering if that's the deciding factor.

I really appreciate your help!

Thanks,
Mike
Nov 7 '06 #11
Michael Windsor wrote:
Are you running PHP on Windows? I'm wondering if that's the deciding factor.
No, I'm on Linux, still with PHP 4.3.

I'm out of explanations for the behaviour you see.
Try switching on

zend.ze1_compat ibility_mode

http://www.php.net/manual/en/migration5.oop.php

I doubt it will have an effect, but it will not do any harm to try it.

--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.
Nov 7 '06 #12
Pedro Graca wrote:
Michael Windsor wrote:
>Are you running PHP on Windows? I'm wondering if that's the deciding factor.

No, I'm on Linux, still with PHP 4.3.

I'm out of explanations for the behaviour you see.
Try switching on

zend.ze1_compat ibility_mode

http://www.php.net/manual/en/migration5.oop.php

I doubt it will have an effect, but it will not do any harm to try it.
It would seem that this is a bug in PHP
(http://bugs.php.net/bug.php?id=38833). Not only that, but the
maintainers of PHP are unwilling to fix it
(http://bugs.php.net/bug.php?id=3792 6)!

IMO, this is not a "documentat ion bug", as some have tried to suggest,
but a flaw in the implementation of the superglobals, or at the very
least in $_SESSION. I have made a contribution to the tracker to reflect
my viewpoint.

Mike
Nov 7 '06 #13

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

Similar topics

0
5759
by: Philip D Heady | last post by:
Ok, I have this form that does a $PHP_SELF post, goes through error checking, then redirects to loc( ); I am setting a session as follows: if(!session_id()) { session_start(); $sid = $PHPSESSID; }
0
2493
by: Phil Powell | last post by:
What is the most standardized method of utilizing the CURL functions in PHP (version 4.3.2) to be able to retrieve the contents of a remote URL that happens to be dependent upon $_SESSION for its content display? I've tried the following class methods for display and I have most everything working until I get to a URL that requires $_SESSION: class Timer extends View {
5
1871
by: h | last post by:
I am at my wits end; I can not see A SINGLE THING I'm doing wrong. I've read every fricking session related doc. I've searched every fricking group. NO ONE seems to have had the problem I'm having - and it doesn't make ANY sense. I'm running php 4.3.3 on a local server; and 4.3.10 on my isp's web server. I've tested this on both with the same results.
21
3092
by: axlq | last post by:
Someone please tell me if I've discovered a PHP bug. I'm sitting in front of several computers on my home network, behind a NAT firewall/router. I am testing my web site on these different computers (running different browsers, logged in as different users, etc.). My web site keeps track of users logged in through the use of $_SESSION. Here's the bizarre thing: All computers are logged off, then I log into my web site with one...
4
2060
by: Pseudonyme | last post by:
Dear Sirs and Madams, Receive as information that storing a MYSQL result under $_SESSION was accelerating web page displays processes ? Absolutly needed but impossible to get this working ! I try, but do not succeed in implement $_SESSION with MYSQL. <?php session_start();
2
2275
by: sharonDonnelly | last post by:
Hi Really dumb problem that's got me beat. Can someone help. The prolem: I'm trying to count the number of times an item has been clicked. There are many items. I want to create a session variable for each item as its clicked, and increment the value held by the session variable by 1 each time that item is clicked. My plan was to allow an item to be selected on one page - when a user selects an item, a numeric value will be passed to a...
7
3366
by: Deccypher | last post by:
Hi Im trying to do something a little more complex with my login script at the moment it works fine, checks the username and password with the database if its wrong it echo's a error and if its right redirects the user to the main page with the session variable logged_in = true but what i have done now is added more feileds into the user table name company email ect. what i want to do is on successful login pull the users information and...
12
1994
by: jodleren | last post by:
Hi I did not notice. A system I have made, seems on one server to keep the $_SESSION even when the browser has been closed... How can I avoid that? WBR Sonnich
3
2186
by: JRough | last post by:
I want to save two variables in a $_SESSION for use in another page: $_SESSION = $mark; $_SESSION = $num; then on the other page I did this to get the value: $mark =$_SESSION; $num = $_SESSION;
0
9969
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10443
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9612
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7999
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7151
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5830
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6029
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4251
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3257
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.