Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7496369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:35:19+00:00 2026-05-29T18:35:19+00:00

I am creating a web app for a business which includes several departments. I

  • 0

I am creating a web app for a business which includes several departments. I am using PHP and MySql to do this, in my database i am storing the privileges as ENUM with options N (No access), R (Read Only) and RW (Read and Write).

Once a user logs in, a php script finds the appropriate privileges and stores those in a session. For example: if a user has RW for Production, then there is a session variable $_SESSION['production'] = RW. Now whenever i need to see if a user is allowed to edit production then i check with the session variable and take appropriate actions.

I have 20 such categories of privileges. This certainly isn’t the way store something like this. This will simply increase the load time and hog plenty of memory. Are there any alternatives to store the user rights?

Note: The 20 category list is expected to grow.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T18:35:21+00:00Added an answer on May 29, 2026 at 6:35 pm

    I typically use

    $_SESSION['privileges']=array(
      'someprivilege' => 'r',
      'someotherprivilege' => 'rw'
    )
    

    to keep the memory requirements in context: 100 privileges, the name consisting of 20 chars, the value of 5 chars, will add up to less than a page (4k). The load time issue is heavily mitgated by PHP using a very efficient bnary serializer on session files.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a web app using PHP and PostgreSQL. Database are too big and
I am creating a web app using C# 4.0. Mysql is being used as
i'm creating a web app that's running on an Advantage Database server, not my
I'm creating a web app (locally, so security doesn't matter) in PHP where the
I am creating a web app which uses jQuery to authenticate: $.ajax({ url: /session/create?format=json,
I'm currently creating a web app using Google's oAuth. I was wondering how I
I am creating a web app in php. i am loading content through a
I'm creating a web app in ASP.NET like this one: http://www.zazzle.com/cr/design/pt-mug I know how
I am creating a web app, and within this app I want to allow
I'm creating web-app using JSR286, Struts2 for portlets on WebSphere Portal 6.1.5 The problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.