CincoPistolero Posted December 21, 2009 Share Posted December 21, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/185950-session-error/ Share on other sites More sharing options...
BahBah Posted December 21, 2009 Share Posted December 21, 2009 It's probably because you're using the same name for your variables as you are your session variables. Quote Link to comment https://forums.phpfreaks.com/topic/185950-session-error/#findComment-981917 Share on other sites More sharing options...
PFMaBiSmAd Posted December 21, 2009 Share Posted December 21, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/185950-session-error/#findComment-981922 Share on other sites More sharing options...
CincoPistolero Posted December 22, 2009 Author Share Posted December 22, 2009 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(); Quote Link to comment https://forums.phpfreaks.com/topic/185950-session-error/#findComment-982653 Share on other sites More sharing options...
PFMaBiSmAd Posted December 22, 2009 Share Posted December 22, 2009 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). Quote Link to comment https://forums.phpfreaks.com/topic/185950-session-error/#findComment-982656 Share on other sites More sharing options...
CincoPistolero Posted December 22, 2009 Author Share Posted December 22, 2009 Yes, the below worked. I just set it on the page having the issue. ini_set('session.bug_compat_42',0); ini_set('session.bug_compat_warn',0); Quote Link to comment https://forums.phpfreaks.com/topic/185950-session-error/#findComment-982681 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.