2017  Kodetalk | Feedback | Privacy Policy | Terms | About
userimage

What is the best way to implement "remember me" for a website at login time

Best way to implement remember me in a web application.
userimage

Try below code as reference which is the new feature of HTML 5.

$('#remember_me').click(function() {
	if ($('#remember_me').is(':checked')) {
		// save username and password
		localStorage.usrname = $('#username').val();
		localStorage.pass = $('#pass').val();
		localStorage.chkbx = $('#remember_me').val();
	} else {
		localStorage.usrname = '';
		localStorage.pass = '';
		localStorage.chkbx = '';
	}
});

Html Code:

<label class="checkbox">
	<input type="checkbox" value="remember-me" id="remember_me"> Remember me
</label>
Answer is