PHP error/warning

driveflexfuel

New Member
Messages
159
Reaction score
0
Points
0
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


The following are all the ways i use session variables. Maybe i am using one in a way the server does not like.
Code:
session_cache_expire(30);
session_start();

if (isset($_SESSION['var_name']))

$var = $_session['var_name']
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
session_cache_expire(30);
session_start();

if (isset($_SESSION['var_name']))

$var = $_session['var_name']

Should be capitalized.

Add:

If that doesn't eliminate the warning, try commenting out the session_cache_expire and see if that is causing the problem (debugging by elimination of suspects).

Add again:
The default for session_cache_expire is 180 minutes. Did you mean to make is smaller?
 
Last edited:

driveflexfuel

New Member
Messages
159
Reaction score
0
Points
0
I did mean to make is smaller but that being the error i suppose ill just get rid of it
 

xadrieth

New Member
Messages
62
Reaction score
1
Points
0
The PHP also needs to look like this:
PHP:
ession_cache_expire(30);
session_start();

if (isset($_SESSION['var_name']))
    $var = $_SESSION['var_name'];

you could also get rid of the "isset()" and it should work the same.
 
Last edited:

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
You forgot the s in session_cache_expire(30);
 
Top