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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:08:14+00:00 2026-05-29T06:08:14+00:00

After researching ways to make a secure log in form with ‘remember me’ functionality

  • 0

After researching ways to make a secure log in form with ‘remember me’ functionality I’ve come across many conflicting views on how to make this secure. The log in system I wish to create does not need to be highly secure, but I’d like to pick a nice secure and easy method and I have two questions.

  1. What should be stored in the session variables to check a user is logged in, is this just username (or ID). If it is just the username, what happens in the case where a user finds their account has been compromised and wishes to change the password to stop the malicious user messing around with their account? If the malicious user has a session then even if the password is changed they can continued being malicious until their session expires, can this be avoided – maybe invalidate all sessions with that username on password change?

  2. Is storing a password (re-encrypted with a salt used just for cookies) and username in a (HttpOnly) cookie a decent enough way of having the ‘remember me’ functionality? I’ve heard ways where a database stores a username and a randomly generated key, and this is also put in the user cookie. Then when a user action occurs the old key is replaced with a new one and given to the user’s cookie. Is this type of cookie security worth it or will the usual re-encrypted password method be sufficient?

  • 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-29T06:08:16+00:00Added an answer on May 29, 2026 at 6:08 am

    Usually if you want to remember the user, you generate a “key” and store it in the database, then set its “lifetime” (this can be anything, like 6 hours or 2 days). You store that key in the cookie (along with the userid). Now, every time the user connects to the website you compare both keys. If the key in the database has exceeded its lifetime, you generate a new key and store it in the cookie. Thus, if someone steals the cookie (somehow) he would have to use it before you connect to the website again and reset the key. This is a method I most commonly see.

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

Sidebar

Related Questions

After researching my options with regards to video support in Java, I stumbled across
I am now creating a sha2 login form after researching and asking for help
After researching a bit how the different way people slugify titles, I've noticed that
After researching various hosts, I still get the feeling that it is somewhat impossible
The old version of the question is below, after researching more, I decided to
So after researching engines a lot I've been building a 2d framework for the
After researching windows mailsots for IPC within a local computer I'm a bit confused
I am researching ways to auto login to a windows server, so applications can
After a few days researching on hashing, generating random numbers or unique keys, I
EDIT: After spending several hours researching this, I don't think I'm going to find

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.