Skip to main content
Inspiring
August 3, 2017
Question

User Login Session conflict and malfunction

  • August 3, 2017
  • 0 replies
  • 336 views

Hello All,

Please has anyone in the forum experienced this kind of issue.

I am currently developing a new application using Dreamweaver CS6. In this new application, I have set my sessions and 3 user access levels; SuperAdmin, Admin, Viewer. SuperAdmin sees all and can add, edit and delete data but Viewer only read data but can't add, edit nor delete data. This has been working well till today.

In the cause of developing the new application today, I logged into one of my old application that I developed last year as a SuperAdmin and also logged into the new application as a Viewer. This means that in one browser (Chrome precisely), I have logged into 2 applications; the new one and the old one.

Now when I opened one of the pages of the new application (not the old application), I observed that my User Menu at the top right hand corner of the page is not showing properly any more. But the main issue is that I could view the side menus and pages that were meant to be seen ONLY by the new application SuperAdmin and Admin. Remember here that in the new application I logged in as a Viewer with limited rights. A number admin pages and menus meant for the SuperAdmin and Admin are hidden from the Viewer but at this time, I could see them all through the Viewer user access level. This is not normal.

When I logged out of the old application, the new application session expired and logged me out. I logged in again ONLY into the new application and everything worked normal as I want it.

Please what could have caused this problem and how can I prevent it. Could it be a Session conflict?

Below is the code I use to redirect Viewers to their own dashboard when they login or try to view a page restricted from them.

if (!isset($_SESSION)) {

  session_start(); 

  if (!isset($_SESSION['MM_UserGroup']) || $_SESSION['MM_UserGroup'] == 'Viewers') {

    header('Location: viewers.php');

exit;

  }

 

}

I use this other code to show Viewers their own side menu. The SuperAdmin and Admin can't see this menu.

        <?php if (!isset($_SESSION['MM_UserGroup']) || $_SESSION['MM_UserGroup'] == 'Viewers'){ ?>

        <li class="active treeview">

          <a href="dashboard.php">

            <i class="fa fa-dashboard"></i> <span>My Dashboard</span>

          </a>

        </li>

        <?php } ?>

Please any help on this issue?

Thank you in advance.

    This topic has been closed for replies.