Pergunta

we moved our website to a new server that came with a new IP address. What puzzles me; the website login sessions do not work on the new server but when I change the database IP to the old server they are working.

MySQL Version :

  1. Old server = 5.1.58- Community
  2. New server = 5.1.68 - Community

At first I thought it was a PHP error but I now believe it's not and suspect its MySQL related. Anyone who knows what might have caused this conflict?

Debugging Error :

Notice: A session had already been started - ignoring session_start() in C:\inetpub\wwwroot\gtest\libs\products.php on line 2 Notice: Undefined index: uUserTypeID in C:\inetpub\wwwroot\gtest\admin\index.php on line 50 Notice: Undefined offset: 0 in C:\inetpub\wwwroot\gtest\admin\index.php on line 52 Notice: Undefined offset: 0 in C:\inetpub\wwwroot\gtest\admin\index.php on line 52

Line 50 :

GetUserType($_SESSION['uUserTypeID'], $UserTypeID, $UserTypeDescr, $Active_Tag);

Line 52 :

if (($UserTypeDescr[0] == 'Admin') || ($UserTypeDescr[0] == 'Report'))

Code overview :

<?php

    error_reporting(E_ALL);
    ini_set('display_errors', True);



    session_start();
    require '../libs/database.php';
    require '../libs/users.php';
    require '../libs/products.php';
    require '../libs/quotes.php';
    require '../libs/common.php';
    require 'functions.admin.php';



    if (!($_SESSION['uAUID']) > 0)
    {
       DisplayLoginForm();

    }
    else
    {

        **GetUserType($_SESSION['uUserTypeID'], $UserTypeID, $UserTypeDescr, $Active_Tag);**

        **if (($UserTypeDescr[0] == 'Admin') || ($UserTypeDescr[0] == 'Report'))**
        {

            if (isset($_POST['eProdID']) && isset($_POST['eProdGroupID']))
            {
                $_SESSION['page'] = 'edit_product';
                $_SESSION['page_header'] = 'Edit Product';
            }
            else if (isset($_POST['eProdGroupID']))
            {
                $_SESSION['page'] = 'edit_product_group';
                $_SESSION['page_header'] = 'Edit Product Group';
            }
            else if (isset($_POST['eAUID']))
            {
                $_SESSION['page'] = 'edit_user';
                $_SESSION['page_header'] = 'Edit User';
Foi útil?

Solução

Check over your included files/code structure.. A usual cause for this error is:

session_start(); 
 /* Random Code here /* 
session_start(); 

Just the duplicate lines of session_start(); So what I will suggest is to look over your included files/main page(s) that you are receiving this error message on, and check for more than one session_start();

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top