Page 1 of 1

PHP Server Code to enabled the Remember Me (Auto Login)

Posted: Wed Aug 28, 2024 12:20 am
by thomas

I have enable the Remember Me (Auto Login) from the Security Option
When my client open the Login Page they have to click on the check box of the Remember Me

Here in my case I want to enable the Remember Me option from the php code
so that when my client open the Login Page there will be no option for the Remember me
But when the client login to the page it should automatically have the function for "Remember me"


Re: PHP Server Code to enabled the Remember Me (Auto Login)

Posted: Wed Aug 28, 2024 8:54 am
by mobhar

Please note that the Remember Me option in the Login page is actullay saved on local side (client's browser).

In other words, after an End-User choosing that option in Login page, then in the future, that option is automatically selected when she/he is trying to login.


Re: PHP Server Code to enabled the Remember Me (Auto Login)

Posted: Wed Aug 28, 2024 12:50 pm
by thomas

Will it work if I change the html code from
<input type="checkbox" name="type" id="type" class="form-check-input" value="a">
to
<input type="checkbox" name="type" id="type" class="form-check-input" value="a" checked style="display: none;">


Re: PHP Server Code to enabled the Remember Me (Auto Login)

Posted: Wed Aug 28, 2024 3:07 pm
by mobhar

That means, you may use Startup Script in Login Page to add those attributes, for example:

$('#type').attr({ 
    'checked': 'checked', 
    'style': 'display: none;' 
});
$('.form-check-label').attr({  
    'style': 'display: none;' 
});