0

am working on one customer's website that is developed in Asp.Net MVC. There is one requirement from the customer to remember the login details or info once user is logged into the website. So the next time user doesn't need to enter the details again. This functionality works fine in Google Chrome but doesn't work in IE for it. I checked the settings in IE by enabling to remember login details but no luck so far. Even i checked many other sites whose login details are saved in IE.

Can you please suggest me some solution if you have come across such problem? Is there any browser compatibilty issue? Looking forward for your reply!!!

  • How about localHost? – mplungjan Jun 11 '18 at 07:49
  • you can use cookies to store login details – Mandar Dhadve Jun 11 '18 at 07:51
  • I am assuming you've read [this](https://support.microsoft.com/en-gb/help/17499/windows-internet-explorer-11-remember-passwords-fill-out-web-forms) article? – Izzy Jun 11 '18 at 07:51
  • I'd suggest you to also read [this](https://stackoverflow.com/questions/549/the-definitive-guide-to-form-based-website-authentication) article also. As well as @Izzy one :) – Margon Jun 11 '18 at 07:52
  • @MandarDhadve - never, ever store a password, even an encrypted password, in a cookie. Instead store a token that you generated when user logged in, and on server you store in a table along with user id, ip and device info (so if cookie is intercepted, can't be used from a different device), and an expiration date-time. https://stackoverflow.com/a/31912700/199364 OR use browser's built-in secure local storage -- much safer than storing in cookie. – ToolmakerSteve Apr 18 '19 at 10:42

1 Answers1

2

localStorage can do that.

https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage

Example:

var loginInfo = {a:"a", b:"b"};

localStorage.setItem('loginInfo', loginInfo);

var getInfo = localStorage.getItem('loginInfo');

console.log(getInfo);

I'm used to save data that way for convenience, but for security, I do not recommend this way.


You can also use document.cookie to achieve that:

document.cookie = "username=John Doe;somthing=Other";

For server side, the most use way is save in the session.

By session, servers can remember who the user is easily and securely.


There're many kinds of remembering user details, so it depends on what you would like to use.

Terry Wei
  • 1,454
  • 8
  • 16