473,385 Members | 1,707 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 error -> Your script possibly relies on a session side-effectwhich existed until PHP 4.2.3.

Hi group,

Does anybody know what causes the following Warning?

__________________________________________________
Warning: Unknown(): Your script possibly relies on a session side-effect
which existed until PHP 4.2.3. Please be advised that the session
extension does not consider global variables as a source of data, unless
register_globals is enabled. You can disable this functionality and this
warning by setting session.bug_compat_42 or session.bug_compat_warn to
off, respectively. in Unknown on line 0
__________________________________________________

Since the whole projectcode is way too much to post here, I hope
somebody has a clue, so I know where to start looking.

It only happens on one Mac here in the office, and only at a certain page.
All other Sessionlogic works as intended, also on the Mac.

The server:
Apache1.3/PHP 4.3,
session.autostart is on.
Sessionstorage is files.
No register globals (of course).

The scripts use only code like this:
$_SESSION["bla"] = "something";
No session_register ancient stuff.

The Mac in question accepts cookies.
The warning is reproducable.

I work a lot with sessions, and this is the first time I see this
warning on my own system.

Can anybody help me?
Where to start bughunting?

I hate the fact the Warning says: "in Unknown on line 0", which isn't
helpful at all of course.

Regards,
Erwin Moller
Jun 2 '08 #1
7 1632
Erwin Moller schreef:

<snip>

Correction: It happens on all systems (also Windows on FF).
(luckily)

Looking into it myself now, but didn't find a thing yet. :-/

Erwin Moller
Jun 2 '08 #2
On Tue, 29 Apr 2008 13:33:19 +0200, Erwin Moller
<Si******************************************@spam yourself.comwrote:
Erwin Moller schreef:

<snip>

Correction: It happens on all systems (also Windows on FF).
(luckily)

Looking into it myself now, but didn't find a thing yet. :-/

Erwin Moller
Does this trigger it:
<?php
ini_set('session.bug_compat_warn',1);
ini_set('session.bug_compat_42',1);
session_start();
$_SESSION['foo'] = NULL;
$foo = "foo";
?>

If so, the warning will _not_ appear:
- if $_SESSION['foo'] exists and is not null
- there's no global variable named $foo

Lousy error message BTW. Just act as usual I'd say, turn of
session.bug_compat_warn & session.bug_compat_42.
--
Rik Wasmus
Jun 2 '08 #3
Rik Wasmus schreef:
On Tue, 29 Apr 2008 13:33:19 +0200, Erwin Moller
<Si******************************************@spam yourself.comwrote:
>Erwin Moller schreef:

<snip>

Correction: It happens on all systems (also Windows on FF).
(luckily)

Looking into it myself now, but didn't find a thing yet. :-/

Erwin Moller

Does this trigger it:
<?php
ini_set('session.bug_compat_warn',1);
ini_set('session.bug_compat_42',1);
session_start();
$_SESSION['foo'] = NULL;
$foo = "foo";
?>
Yes, it does trigger it.
(I had to remove session_start() because that added another warning
since I had autostart on on the machine)
>
If so, the warning will _not_ appear:
- if $_SESSION['foo'] exists and is not null
- there's no global variable named $foo
Aha, now I get the error.

Let me summarize: PHP is wasting time by checking if I use variablenames
in my script that exists as a key in the $_SESSION?
Jeeez... What a waste of CPU resources. :P

I am surprised I never had this warning before, since I NEVER paid any
attention to similarity in names in SESSION and my scriptvars. ;-)
>
Lousy error message BTW. Just act as usual I'd say, turn of
session.bug_compat_warn & session.bug_compat_42.
Thanks Rik for your clear and fast reply.

And yes, very lousy description of the error/warning indeed.

I'll immediately change the php.ini to surpress these nonsense warnings.

Thanks.

Erwin Moller
Jun 2 '08 #4
On Tue, 29 Apr 2008 14:18:50 +0200, Erwin Moller
<Si******************************************@spam yourself.comwrote:
Rik Wasmus schreef:
>On Tue, 29 Apr 2008 13:33:19 +0200, Erwin Moller
<Si******************************************@spa myourself.comwrote:
>>Erwin Moller schreef:

<snip>

Correction: It happens on all systems (also Windows on FF).
(luckily)

Looking into it myself now, but didn't find a thing yet. :-/

Erwin Moller
Does this trigger it:
<?php
ini_set('session.bug_compat_warn',1);
ini_set('session.bug_compat_42',1);
session_start();
$_SESSION['foo'] = NULL;
$foo = "foo";
?>

Yes, it does trigger it.
(I had to remove session_start() because that added another warning
since I had autostart on on the machine)
Euhm, doh, yes offcourse :).
> If so, the warning will _not_ appear:
- if $_SESSION['foo'] exists and is not null
- there's no global variable named $foo

Aha, now I get the error.

Let me summarize: PHP is wasting time by checking if I use variablenames
in my script that exists as a key in the $_SESSION?
Jeeez... What a waste of CPU resources. :P
Indeed, what a waste. I suspect turning of session.bug_compat_42 will halt
that checking.
I am surprised I never had this warning before, since I NEVER paid any
attention to similarity in names in SESSION and my scriptvars. ;-)
As you shouldn't have to :) (and global variables should be few
offcourse...)
> Lousy error message BTW. Just act as usual I'd say, turn of
session.bug_compat_warn & session.bug_compat_42.

Thanks Rik for your clear and fast reply.

And yes, very lousy description of the error/warning indeed.

I'll immediately change the php.ini to surpress these nonsense warnings.
Nonsense indeed, amen.
--
Rik Wasmus
Jun 2 '08 #5
Rik Wasmus schreef:

<snip>
>I'll immediately change the php.ini to surpress these nonsense warnings.

Nonsense indeed, amen.
Hi Rik,

I include an ini_set routine in all my projects these days, and added
them over there. Now the warning is gone. :-)

And now for the fun part:
session.bug_compat_42 or session.bug_compat_warn both don't exists in my
php.ini. sigh.
Am I expected to just add them?

I am used to changing ini values, but never added new ones before.
(and this is a productionserver)
Do you think I could just add them, kick Apache, and be done with it?

Regards,
Erwin Moller
Jun 2 '08 #6
On Tue, 29 Apr 2008 15:00:35 +0200, Erwin Moller
<Si******************************************@spam yourself.comwrote:
Rik Wasmus schreef:

<snip>
>>I'll immediately change the php.ini to surpress these nonsense
warnings.
Nonsense indeed, amen.

Hi Rik,

I include an ini_set routine in all my projects these days, and added
them over there. Now the warning is gone. :-)

And now for the fun part:
session.bug_compat_42 or session.bug_compat_warn both don't exists in my
php.ini. sigh.
Am I expected to just add them?

I am used to changing ini values, but never added new ones before.
(and this is a productionserver)
Do you think I could just add them, kick Apache, and be done with it?
Sure, lots of values aren't specifically set in many normal php.ini, so
they just take the default (which sadly in this case would be "on" for
both of them). Just set them & reload Apache.
--
Rik Wasmus
Jun 2 '08 #7
Rik Wasmus schreef:
On Tue, 29 Apr 2008 15:00:35 +0200, Erwin Moller
<Si******************************************@spam yourself.comwrote:
>Rik Wasmus schreef:

<snip>
>>>I'll immediately change the php.ini to surpress these nonsense
warnings.
Nonsense indeed, amen.

Hi Rik,

I include an ini_set routine in all my projects these days, and added
them over there. Now the warning is gone. :-)

And now for the fun part:
session.bug_compat_42 or session.bug_compat_warn both don't exists in
my php.ini. sigh.
Am I expected to just add them?

I am used to changing ini values, but never added new ones before.
(and this is a productionserver)
Do you think I could just add them, kick Apache, and be done with it?

Sure, lots of values aren't specifically set in many normal php.ini, so
they just take the default (which sadly in this case would be "on" for
both of them). Just set them & reload Apache.
Thx again.
Worked like a charm. :-)

Regards,
Erwin Moller
Jun 2 '08 #8

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

Similar topics

5
by: Tony Wright | last post by:
Hi, I am having a problem installing an msi for a web site. The error message I am getting is: "The specified path 'http://mipdev05/features/Fas2' is unavailable. The Internet Information...
1
by: Aravind | last post by:
we have two files: 1. rc4.c (defines one function "create_pin()") 2. MyImpl.c(calling the function "create_pin()"),This implements JNI method. 1.When I am trying to create .dll file with one...
1
by: yanwan | last post by:
I met this problem in executing a c++ project in visual studio. Does anyone have suggestions to resolve "error lnk 2001"? --------------------Configuration: reconstruction - Win32...
5
by: Enos Meroka | last post by:
Hallo, I am a student doing my project in the university.. I have been trying to compile the program using HP -UX aCC compiler, however I keep on getting the following errors. ...
3
by: Andrew Luke | last post by:
Hi all you C++ guru's! I'm 'very, very' new to C++ and I'm having a little trouble configuring my VS environment I think - when I try and compile some sample code I'm getting the following...
2
by: Gregory | last post by:
Hi, One of the disadvantages of using error handling with error codes instead of exception handling is that error codes retuned from a function can be forgotten to check thus leading to...
5
by: azgoddess1 | last post by:
During the installation I get these error messages: ***** SQL1390C The environment variable DB2Instance is not defined or is invalid An error ocured while loading the command "C:\Program...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
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:
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...
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.