3
Contributors
4
Replies
40
Views
3 Years
Discussion Span
Last Post by SimonIoa
2

When you create the login cookie, simply specify an expire time loooong into the future if the remember me checkbox is ticked.

0

I think your Google skills are as good as ours. I would imagine that most of us would have to search unless somebody felt the urge to write something for you. As Dani says, the implementation revolves around setting a future distant expiring cookie.

0

Thanks. Yes i got it. I saw something online that could work. If it does i will post it here for other users...

0

This one should work right?

if($_POST['user'] && $_POST['passcode'] )
{
    $username=$_POST['user'];
    $password=$_POST['passcode'];
    if (strlen($username)>0 && strlen($password)>0)
    {
        $login=$User->User_Login($username,$password);

        if($login)
        {
            if(isset($_POST['remember'])){
            setcookie("cookname", $username, time()+60*60*24*100, "/");
            setcookie("cookpass", $password, time()+60*60*24*100, "/");
            }
            $_SESSION['uid']=$login;
            header("Location:index.php");
        }
        else
        {
            $login_error="<span class='error'>Username or Password is invalid</span>";
        }
    }
}





                        <div id="label"><?php echo $lang['UsernameOrEmail'];?>:
                        <input type="text" name="user" class="input" AUTOCOMPLETE='OFF'/>
                        </div>
                        <input type="checkbox" name="remember" /> Remember Me<br /><br />

                        <div id="label"><?php echo $lang['password'];?>:
                            <input type="password" name="passcode" class="input" AUTOCOMPLETE='OFF'/>
                            <div ><?php echo $login_error; ?></div>
                        </div
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.