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 7568405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:55:01+00:00 2026-05-30T14:55:01+00:00

recently I tried to like develop my own login system. I am sure someone

  • 0

recently I tried to like “develop” my own login system. I am sure someone already did this before, but this is a summary of how it works.

Of course, there is a “members” table which contains data like ID, username, bcrypt encrypted password, email, and other data.

Secondly, there is another database called “sessions”, it contains a custom session hash, and user’s ID.

Now, when someone logins, after all checks have been done, the script would generate a unique 32 chars long hash, and store it in user’s session information. The same session hash would be inserted into the “sessions” database, together with the ID, of the user which logged in.

When it checks if the session is valid, it would check if this session exists in the database. If it does, then check if the user’s last action was more than 15 minutes ago. If it is, then the session has expired, and delete it from the database, thus logging the user out.

I would like to hear your opinions on this system, and how can I improve it.

Thanks!

  • 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-30T14:55:03+00:00Added an answer on May 30, 2026 at 2:55 pm

    Many things you can do, but your system is pretty much right on. The only thing I can suggest is storing the IP address of the remote user in the session table as well. If you don’t do this, then your app will be vulnerable to session theft. This is less of a problem if you make sure that the session hash is always sent over SSL, but if not, it is possible that someone can get that 32 character session hash and use it to steal someone’s session and gain access to the system without logging in.

    So, you would check to make sure that when you check for a valid session in the sessions table, you also check that the ip address still matches. The only draw back is that for some valid users, their ip address may change in the middle of a session, thus logging them out while they are doing something. This is less of a problem these days as broadband is more and more popular.

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

Sidebar

Related Questions

Recently I tried compiling program something like this with GCC: int f(int i){ if(i<0){
I recently tried to create an object like this: var carousel = { $slider:
I have tried using some browser based IDE's like cloud9 IDE recently. But it
I recently tried to combine SEAM and GWT in a project - but failed
Why is typeid(someType) not constant like sizeof(someType) ? This question came up because recently
I recently came across some functions where you can pass multiple enums like this:
Recently I had to develop several web applications. I did extensive research regarding JavaScript
I recently tried to make a game server controller in Perl, I would like
I recently tried to figure out how to use freeglut with NetBeans 7. I
I recently tried using the Cloud9 online IDE . It starts by creating a

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.