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

  • SEARCH
  • Home
  • 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 8872755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:17:52+00:00 2026-06-14T18:17:52+00:00

Let’s say we have this awesome User system before us, a User is logged

  • 0

Let’s say we have this awesome User system before us, a User is logged in by a session key (user_id) is set. If a User however gets “banned” the user will still be logged in – until the session expire.

Ways to prevent this is:

  1. Always check if user got banned (every request)

  2. save session data in perhaps a database to be able to remove the data easily (on the user being banned).

Is there a better approach performing this task?

  • 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-06-14T18:17:53+00:00Added an answer on June 14, 2026 at 6:17 pm

    I would choose 1. If you don’t retrieve user information from your database in each request, users may also have trouble updating their data. For instance, I can log in at home, change my profile description to ‘foo’ and go work. There I log in as well, which results in a different session. I change the information to ‘bar’, which is stored in the database and in my work session. Then I go home and continue browsing in the previously opened home session, which will still contain ‘foo’.

    Therefor, I think you should at least do some checking against the user database on each request, so during that step you can check if the user is banned as well.

    To speed this up, you could keep a special table with storage type MEMORY to keep session information in. This table can be accessed really fast, so it may increase performance. You only need to move information there if a user has changed in the ‘real’ database. You may use memcache in a similar way. Both are solutions to keep database IO to a minimum while still having the same results. I would add these optimizations only when you need them. Start with just querying the user on each request.

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

Sidebar

Related Questions

Let's say I have a method in java, which looks up a user in
Let's say I have a sortable list like this: $(.song-list).sortable({ handle : '.pos_handle', axis
Let's say I have a string like this: var str = /abcd/efgh/ijkl/xxx-1/xxx-2; How do
Let's say I have this element for displaying the website logo: <div id="web-title"> <a
Let's say I have this code: <p dataname=description> Hello this is a description. <a
Let's say on a page I have alot of this repeated: <div class=entry> <h4>Magic:</h4>
Let's say I have a text file composed like this ##### typeofthread1 ##### typeofthread2
Let's say I have an facebook application running using the JS SDK. First user
Let's say I have a user enter the URL of an image. After URL
Let's say I have a list containing some key-value pairs, and an array containing

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.