Solved

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 dat

Posted on 2010-11-16
3
472 Views
Last Modified: 2012-06-27
Hi,

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

Above is the warning I receive on some on my pages, a common topic on ee, is this regarding the code below? If not how do I find the line it refers to as the warning states line ‘0’

<?php
session_start();

if (!$_SESSION["valid_user"])
{
// User not logged in, redirect to login page
Header("Location: login.php");
}

Open in new window

0
Comment
Question by:AlexAmbler
  • 2
3 Comments
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 34151983
It's a configuration variable.  Assume you are at PHP 5+, right?  Ask your hosting company to turn this old thing off.
0
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 250 total points
ID: 34151987
However that said, this is not a good form of code:

if (!$_SESSION["valid_user"])

Maybe you wan to be more at this:

if (!isset($_SESSION["valid_user"]))

The values for FALSE are loosely typed in PHP.  If you tighten up your code, you will almost certainly get better outcomes.
0
 

Author Closing Comment

by:AlexAmbler
ID: 34209855
thank you.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Correct syntax for subdirectories 9 33
PHP 5.6 and 7.x 4 37
Length of for loop to be dynamic 2 31
How do I speed up this PDO query 4 11
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question