I was wondering if there was a way to make a "remember me" button for a login form. I am working on a javascript only login box, that is pretty secure, but I just need to know how to make that remember me checkbox! Please help!

Here is the current client side code:

<html>

<head>
    <title>Login</title>
<script type="text/javascript">
<!--
function authPass(u,p) {
    if (u && p) self.location = "auth.htm?" + u + p;
    return false;
}
// -->
</script>
<link href="style-home.css" type="text/css" rel="stylesheet" />
</head>
<body>
    <div>
<script type="text/javascript">
<!--
if (location.search.indexOf("auth=failed") != -1) {
    document.write("<span style=\"color:#ff0000\">Login Failed!  You have entered the incorrect authorization information, please try again.</span>");
}
// -->
</script>
        <form id="form1" action="javascript://" onsubmit="return authPass(this.user.value,this.pass.value)">
            <table>
                <tr>
                    <td>Username: </td><td><input type="text" name="user" /></td>
                </tr>
                <tr>
                    <td>Password: </td><td><input type="password" name="pass" /></td>
                </tr>
                <tr>
                    <td colspan="2" align="center"><input type="submit" value="Login" /></td>
                </tr>
            </table>
        </form>
    </div>
</body>
</html>

It's just a checkbox. You should have code on submit to store enough information to login in a cookie. When you access your page, you can check if it exists with valid info, and if so, submit automatically.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.