Quick hints: How to ensure your site remembers your visitors' credentials so that they don't have to login every time
If you need to make life easier for your portal's registered users, you may have to make it remember them so that they won't have to retype their credentials next time they visit.
Making "remember me" always checked
By default, DNN's "remember me" checkbox on the login page is visible and unchecked. In order to make it checked by default, you'll have to edit the /DesktopModules/AuthenticationServices/DNN/Logon.ascx file (assuming DNN 6.2 but probably same in earlier versions) and find the following control:
<asp:checkbox id="chkCookie" resourcekey="Remember" runat="server" />
Add a checked="true" attribute to the control as follows:
<asp:checkbox id="chkCookie" resourcekey="Remember" checked="true" runat="server" />
And the checkbox will always be checked by default.
If you upgrade your DNN installation sometime in the future, you'll probably lose this setting, so keep in mind that you may have to edit the file again after an upgrade.
Defining the "remember me" duration
The second thing you should define is for how long a user will be remembered. This is controlled by a key in your web.config file, under the <appSettings> section:
<add key="PersistentCookieTimeout" value="0" />
The value expresses duration in minutes. So, if you need your portal to remember your users for, let's say, a month, that's 60*24*30 = 43200. A year would be 60*24*365 = 5252600 and so on.
It's important to set that value, since your "remember me" functionality may not work at all, especially in older DNN versions that are using an ASP.NET 2.0 application pool. For more details, see here and also here.
Ensuring that the "remember me" checkbox is enabled
Finally, if you don't see the "remember login" checkbox at all, it may have been disabled in your DotNetNuke installation. The setting to disable or enable the remember me functionality is under Host Settings - Basic Settings - Host Details - "Enable remember me on login controls" checkbox.
0 comments:
Post a Comment