DNN Remember Login

The Remember Login checkbox on a DNN website doesn’t work on a new website installation.

Ticking the checkbox when logging into the website has no effect when returning to the site.

To experiment I ticked the Remember Login box and entered the login details, gaining access as expected. I used the logout link on the website, returning to the site – I hadn’t been remembered.

I also tried variations of closing the browser, whilst still logged in and logging out, and then closing the browser before returning.

For the Remember Login feature to work a cookie needs to be set. With the default website configuration this isn’t done.

The Remember Login feature requires the cookie timeout to be amended, from the default value of 0, to a longer time, for example a month.

The cookie timeout PersistentCookieTimeout value, is configured in the web.config file. The sample piece of code shown below is taken from the web.config file it shows the start of the appSettings section and the  PersistentCookieTimeout key and its value of 0.

<appSettings>
...
<add key="PersistentCookieTimeout" value="0" />
<!--use as persistent cookie expiration. Value is in minutes, and only active if a non-zero figure-->

A value of 1 represents one minute. The table below shows some common values and their associated durations:

ValueDuration
72012 hours
14401 day
28802 days
43203 days
57604 days
72005 days
86406 days
100801 weeks
201602 weeks
302403 weeks
403204 weeks
432001 month (30 days)

On my local test site I used a value of 43200, 30 days. A shorter duration is preferable, security wise. With a shorter setting there is less likelihood of cookies being stolen and reused to allow nefarious login to the website. The issue here is the compromise between the remembered access allowing permitted users to gain access conveniently and avoiding creating a security risk.

You may feel that 3.5 days is a good duration to choose. This will allow the feature to be available for those with an intermittent, perhaps every other day access, and to cover the weekend too.

If you wish to hide this checkbox its accessed on the host pages. Navigate to the Host/Host Settings page. Expand the section Host Details. Ensure that the checkbox for Enable Remember me on login controls is ticked. Click on Update at the bottom of the form to save any changes.