Jump to content

session error


CincoPistolero

Recommended Posts

here is the error

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.

 

Hosting server is php 5x. I'm not passing any variables from one page to another, just session variables

 

page1

session_start();
$_POST['uname'] = stripslashes($_POST['uname']);
$_SESSION['userName'] = $_POST['uname'];
$_SESSION['password'] = $_POST['passwd'];
$_SESSION['acctType'] = $info['acctType'];
$_SESSION['loggedIn'] = $info['loggedIn'];
$db_object->disconnect();
?>

<script language='javascript'>
location.replace('../appl.php');
</script>

 

page 2

<?php
session_start();
$applName = $_SESSION['userName'];
$query = "SELECT * FROM table WHERE userName='$applName'";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
$row_emp = mysql_num_rows($result);
if($row_emp > 0){
$row= mysql_fetch_array($result);
extract($row);
}else {}
$applUserID =$row['pwUserID'];
$_SESSION['pwUserID'] = $applUserID;
if ($row['firstLogin'] == 0) {
//Change password and set Security Question
?>

 

I know I've been forced to use $_GET when passing variables from page to page, but I don't believe that is what is causing this error. Also, this is on a shared server, so I  can't edit the php.ini file.

 

any help would be mui appreciated.

Link to comment
https://forums.phpfreaks.com/topic/185950-session-error/
Share on other sites

The whole error message mentions turning off one or both of the session.bug_compat_42 and session.bug_compat_warn settings. The easiest way to deal with the problem is to turn off one or both of the session.bug_compat_42 and session.bug_compat_warn settings.

Link to comment
https://forums.phpfreaks.com/topic/185950-session-error/#findComment-981922
Share on other sites

I found this link - http://preetul.wordpress.com/2007/05/07/your-script-possibly-relies-on-a-session-side-effect-which-existed-until-php-423-please-be-advised-that-the-session-extension-does-not-consider-global-variables-as-a-source-of-data-unles/

 

I then switched my session variables to the below and I still get the error. Once again, I don't have the ability to change the php.ini file.

 

/*this is where i need to work some session table magic */
session_start(); 
$logdIn = $info['loggedIn'];
$_POST['uname'] = stripslashes($_POST['uname']);
$uname = $_POST['uname'];
$pwd = $_POST['passwd'];
$aType = $info['acctType'];

$_SESSION['userName'] = $uname;
$_SESSION['password'] = $pwd;
$_SESSION['accType'] = $aType;
$_SESSION['loggedIn'] = $logdIn;
$db_object->disconnect();

Link to comment
https://forums.phpfreaks.com/topic/185950-session-error/#findComment-982653
Share on other sites

Both settings that have been mentioned can be changed in PHP_INI_ALL. This means any of -

 

A) The master php.ini (when you have access to it),

B) a .htaccess file (when php is running as an Apache Module),

C) a local php.ini (when php is running as a CGI application),

D) in your script using an ini_set() statement,

E) in a http.conf or even the Windows registry if you have access to them...

 

I'm going to guess you can use B), C), or D).

Link to comment
https://forums.phpfreaks.com/topic/185950-session-error/#findComment-982656
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.