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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:14:00+00:00 2026-06-09T17:14:00+00:00

Using ASP.NET MVC, Entity framework, jQuery. I want to give users the ability to

  • 0

Using ASP.NET MVC, Entity framework, jQuery. I want to give users the ability to automatically log in if they have clicked “Remember me”, The approach I’ve come up with is:

  1. When a user logs in
    • Hash PW and store in DB
      if when the user logs in & they tick ‘remember me’
    • Create a cookie, with a encrypted UserID then some sort of separator and the hashed PW.

Then the next time the user comes back, I can check for their cookie, and if it exists I log them in with AJAX. If the user logs out I of course delete their cookie.

Is this the correct way to accomplish the automatic log in functionality?

I guess my hashing function and User ID encrypting func will be server side, and to create the cookie I’ll call that function via AJAX, then create it.

Is this best practice?

Thankyou

  • 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-09T17:14:02+00:00Added an answer on June 9, 2026 at 5:14 pm

    Your approach (having a cookie with a value indicating the user is logged in) is fairly standard.

    What is not standard is storing the hashed username and password (in particular the password) – not sure why you would need to and since cookies are transmitted in clear text (for http connections), you are giving anyone between your site and the user the ability to see the password hash and a chance to break it in order to get the password.

    Instead of a password hash, create a unique “loggedIn” token (say a GUID) that you store in the cookie – this is what you compare to in order to determine whether a user is logged in.

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

Sidebar

Related Questions

I am using the asp.net mvc with the Entity Framework. I have a list
I have an application developed in ASP.NET MVC using Entity Framework / Sql Server
I have an ASP.NET MVC 3 (using Entity Framework 4.2) application that uses transactions
I'm building an ASP.NET MVC site using the ADO.NET Entity Framework. I have an
I'm using ASP.NET MVC 3 with Entity Framework CodeFirst I have two classes as
I have a ASP.NET MVC 2.0 application using Entity Framework. All my views use
I am using ASP.NET MVC 3 with Entity Framework 4 using POCOs and want
I have an existing website developped using ASP.NET MVC 3 and Entity Framework 4
General Info: ASP.NET MVC app using ADO.NET Entity Framework SQL Server 2005 I have
I am building a website using ASP.NET MVC and entity framework. I have 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.