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
456 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 108

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 108

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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 …

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now