Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

how to set “Remember me” as a default setting?

edited September 2010 in Vanilla 2.0 - 2.8
My visitors want to remember their cookies in their computer and they don't want to click the option to select "Remember me on this computer" when they sign in.

So, how to set "Remember me on this computer" as a default setting?
Tagged:

Comments

  • Good idea
  • ithcyithcy New
    edited September 2010
    go into applications/dashboard/views/entry and edit a few files:
    auth/password.php
    registerbasic.php
    registercaptcha.php
    registerinvitation.php
    signin.php

    Inside those files, search for the line containing RememberMe. It looks something (but not always exactly) like this:
    echo $this->Form->CheckBox('RememberMe', T('Remember me on this computer'), array('value' => '1', 'id' => 'SignInRememberMe'));
    you want to add 'checked'=>'checked' to that last array. So the final line will look like this: echo $this->Form->CheckBox('RememberMe', T('Remember me on this computer'), array('value' => '1', 'id' => 'SignInRememberMe', 'checked'=>'checked'));

    Of course this means editing the core files and that is a Bad Idea (tm). There's probably another way to do this by using a theme, but I don't know for sure.
    //edited for silliness, see below
  • Actually there's more to it than this, now that I think about it a little more. If they uncheck the checkbox, it won't stay unchecked next time they load the form. Something else needs to happen to save their preference in a cookie.
  • Oh well, gets the job done that we need... thanks! :P
  • go into applications/dashboard/views/entry/auth/password.php and edit


    Inside those files, search for the line containing RememberMe. It looks something (but not always exactly) like this:
    echo $this->Form->CheckBox('RememberMe', T('Remember me on this computer'), array('value' => '1', 'id' => 'SignInRememberMe'));
    you want to add 'checked'=>'checked' to that last array. So the final line will look like this: echo $this->Form->CheckBox('RememberMe', T('Remember me on this computer'), array('value' => '1', 'id' => 'SignInRememberMe', 'checked'=>'checked'));


    thanks! it works.
Sign In or Register to comment.