Question

I had some issues with authentication on MVC5, so to test it, I created a MVC5 project using the default template, didn't change anything.

If i run it with visual studio (debug/release), when I authenticate checking the RemindMe box, it keeps me logged in like forever. However, the same code, if I publish it, when I log in, after about 5 minutes I get logged out.

I'm using GoDaddy to host it. BTW, there is only one change i had to make. I had to set in the web.config to run in Full Trust.

<system.web>
  <authentication mode="None" />
  <compilation debug="true" targetFramework="4.5" />
  <httpRuntime targetFramework="4.5" />
  <trust level="Full" />
</system.web>  

I'm struggling to fix this. Does anyone have any clue on what could be causing that?

Was it helpful?

Solution

Try specifying an explicit <machineKey> in Web.config. For instructions on how to generate a <machineKey> element yourself, see http://support.microsoft.com/kb/2915218#AppendixA. (Always generate keys yourself; never copy and paste one that you got from an online generator.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top