Hi, everyone...
I've noticed a few people having issues with unchecking the automatic login checkbox across various versions, and was hoping for some assistance.
I'm running the latest CS2007 build, but changing the checkbox's value to 'false' on the login.aspx page doesn't produce the desired result.
I noticed this code in a similar thread:
<script language="C#" runat="server">protected override void OnPreRender (EventArgs e) { if (this.Page.Request.Cookies["CommunityServer-AutoLoginCookie"] == null) autoLogin.Checked = false;}</script>
But it produces the dreaded 'Oops...' page upon implementation.
Any suggestions re: how to uncheck this by default - perhaps by editing the cookie's default data?
Thanks!
Are you attempting to make it so the button defaults to being unchecked, or are experiencing an issue where even when you uncheck the Remember Me checkbox, you are still being remembered?
There was a bug where if you had previously checked remember me, it would always remember you (even if you chose not to later on) because it was overriding the user's option when processing the login. This bug was fixed with in CS 2008 and the CS 2007.1 SP1 we released the day after CS 2008 RTM'd.
If you are trying to make it default to not being checked, then it looks like there is somewhat of an issue with that. The default value of the checkbox is ignored, since even when an AutoLoginCookie doesn't exist, the default internally in the code is true, and it gets set overriding the default in the aspx page. I've logged this as item number 581 to look at for correcting in a service pack.
In the meantime, try doing the following:
<script language="C#" runat="server"> protected override void OnPreRender (EventArgs e) { if (this.Page.Request.Cookies["CommunityServer-AutoLoginCookie"] == null) ((CheckBox)CSControlUtility.Instance().FindControl(loginForm, "autoLogin")).Checked = false; } </script>
Hi, Ken...
Thanks for the help. I've implemented this solution and early returns seem to indicate it's working as planned for defaulting to an unchecked box.
Thanks again for the speedy reply!
Unfortunately, while this approach does succeed in leaving the checkbox unchecked by default, it still functions as if the user has chosen to automatically sign in - regardless of the field's selection.
Logging in anonymously, I do see an unchecked box by default, however after signing in and closing/restarting the browser I'm automatically signed in again. If I sign out, then return to the login screen, the box is now checked by default.
Would this be an instance of the cookie still being written with the automatic login enabled?
I'd appreciate any help on the matter - thanks!
Copyright© 2008 Telligent Systems Inc. All rights reserved CommunityServer.com • Telligent.com