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
471 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 109

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 109

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

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.  …
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

828 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