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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:33:58+00:00 2026-06-15T22:33:58+00:00

Is it inadvisable to store a hashed password in a user object in (server-side)

  • 0

Is it inadvisable to store a hashed password in a user object in (server-side) session? It goes without saying that a salted and hashed password needs to be retrieved at some point to compare the hash to authenticate a given user, but once the comparison has taken place is there a quantifiable security risk associated with keeping it in the user object?


Given the discussion in the comments, the gist of the question was that password and hash data would be stored in the user object with the rest of the user data once retrieved from the database in a single, clean call. I understood before posting the question that of course there is a risk, but is it viable enough to warrant implementing a framework to clear it from the user, or would doing so just amount to good practice?


Given the responses, what I believe to be the best solution is to have a credentials object containing the password and salt that is associated with the user by ID but not stored directly in it.

When a user attempts to log in, the user object (which contains no password data) is retrieved from the database by email/username. The ID is then read and used to retrieve the associated credentials object. Password verification can then take place. If the password is correct, the user is put in session and the credentials object destroyed.

The result is a user object free of password data, so any potential associated security risks (however minimal they may be, as discussed in the question) are avoided. The other upshot is that there is no manual clearing of password data from the user object before its use. This is a more reliable system than requiring the data to be cleared each and every time, and if EF or a similar technology is being used there is no risk of accidentally erasing password data when the object’s changes are pushed to the database.

  • 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-15T22:33:59+00:00Added an answer on June 15, 2026 at 10:33 pm

    Personally I don’t see any reason not to. If the salted hash is secure, storing it in the server-side session shouldn’t be any less secure than storing it in the database.

    After all, the whole point of using a good salted hash is that even if your database is compromised and someone obtains all the salted hashes, they still wouldn’t be able to recover the actual passwords.

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

Sidebar

Related Questions

I'm a Python & App Engine (and server-side!) newbie, and I'm trying to create
I have two products that are always installed in tandem. One is an ActiveX
I'm working on a Java-based web app using Tomcat 7.0 as the application server.
I have some old C 32 Bit DLLs that are using Oracle's Pro C
I have a TreeView that uses an DataTemplate to customize the appearance of each
I am trying to create a simple error message that should disapear on page
i am designing a app for some quiz. i need an activity that starts
I'm working with a legacy system that I'm experimenting with adding NHibernate to. I
In my script I have four functions that work like this: def function_four(): #
Catching Throwable is unadvisable for reasons outlined in different posts. However, would it make

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.