Results 1 to 4 of 4

Thread: Display menu according to session and security

  1. #1
    Join Date
    Sep 2009
    Posts
    177

    Display menu according to session and security

    Early security issues:

    I have a site with authentication (two different types of users). Thus, according to the type of user logged on, I want to display a specific menu.

    When it connects, I open a session and attribute him his rights (eg $_SESSION['right_user'] = admin or user...)

    Then when I open the page I retrieved the value of session and I compare:
    Code:
    switch($_SESSION['right_user'])
    case "admin": include("menu_admin.php" );
    break;
    case "user": include("menu_user.php" );
    break
    My questions:
    1 - Using "include" with session variables is secure? if it is not secure, ten what do you offer me?
    2 - From a security point of view, the session variables are well protected?

  2. #2
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Display menu according to session and security

    1 - yes, you can do that for testing out the contents of $_SESSION['right_user'] (you know where and how it changed)
    2- yes. the issue is rather to point to change the value of its variable. If the user can act on the scripts that update the session variables, you have a risk.

  3. #3
    Join Date
    Sep 2009
    Posts
    177

    Re: Display menu according to session and security

    Thank you for your reply.

    How a user can do it on the scripts? I try to document a maximum on the flaws of websites, can you provide an explanation or any other things that can be used to protect a website?

  4. #4
    Join Date
    May 2008
    Posts
    271

    Re: Display menu according to session and security

    You just need to verify in menu_admin.php that your session is one of the admin ...

    Later, at fault, everything that comes from the user is a potential hole (ie not necessarily reliable):
    - The user agent
    - Ip address
    - The downloaded file
    - The contents of $_POST
    - The contents of $_GET
    - ...

    in short, everything that your customer does not read a page, but interact with it.

Similar Threads

  1. Replies: 4
    Last Post: 17-01-2011, 11:14 AM
  2. I want Opera to display Menu at the top
    By Mustafa k in forum Technology & Internet
    Replies: 5
    Last Post: 07-01-2011, 07:38 AM
  3. Replies: 4
    Last Post: 24-12-2010, 07:58 AM
  4. Display of the Program Menu In Windows 7 As the Cascade Menu
    By dinkster in forum Customize Desktop
    Replies: 4
    Last Post: 04-12-2010, 11:14 PM
  5. Replies: 3
    Last Post: 16-05-2009, 02:00 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,034,656.97214 seconds with 17 queries