$_session error

Started on the old forum in March 2011 · view the original in the archive · old links redirect here

4 replies · 573 views · started 15 years ago · 1 min read

3 participants
adex3g Developer · 181 posts #1

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

i got this error becuase i am using global variable with mysession. pls do any body know the solution to that error warn,

NOTE: ONLY REPLY IF THIS AS HAPPEN TO YOU BEFORE,

have connected with http://adexchat.com ? Fun up with http://forum.adexchat.com

djdevil89 Senior · 287 posts #2

I had this error before. simply put this in your script

ini_set("display_errors", 0);

it will work anyway

foreach ($_SERVER as $server => $value)
{
echo "$server is $value<br />";
}
frostymarvelous Senior · 266 posts #3

Happened to me, but I can't remember what happened. Please post the line and ill remember what I did. Best not to ignore deprecated warnings

Perfection comes at a cost

I accept liberty!

frostymarvelous Senior · 266 posts #5

I did some research.

If you try to assign a session var in a function, make sure the variable you are trying to assign to it is not unset. Make sure it is available in the functions scope.

Added after 11 minutes:

It seems this happens when you try to assign a variable which doesn't exist to the session.

Perfection comes at a cost

I accept liberty!

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close