Search code examples
asp.net-mvc-5asp.net-identity

Does 'Remember Me' functionality work when testing app locally


When testing my mvc app.. I have to login each time I run it. I have checked the 'Remember Me' checkbox but it does not work when testing my app locally.

But when I deploy to my dev server and check 'Remember Me' it works.

Can the 'Remember Me' functionality work when testing my app locally?


Solution

  • It depends on what you're doing. If I had to guess, I'd say that when you're talking about "each time [you] run it", you mean debugging. The default for a project in Visual Studio is to start and stop the IIS Express process each time you start/stop debugging. The session (both Session and your auth) is going to be process bound in that scenario, and will effectively be destroyed each time IIS Express shuts down.

    If you want the process to continue even after you stop debugging, you'll need to edit your project's properties and uncheck "Enable Edit and Continue" in the "Web" tab there.