php - A data breach on a site exposed your password message sent by chrome on my login form

55

I made a login form, an authenticated user is redirected to their home page. But, along with redirection chrome sent me this This is the message sent by chrome

I know nothing about the warning. My code is:

     /**
     * Go Login, login button is clicked
     * 
     * @return void
     */
    public function goLoginAction()
    {
        $user = new User($_POST);

        if ($user->verifyPassword()) {
            $user = User::findByUsername($user->username);

            Auth::login($user);

            $this->redirect("/$user->username/home/");
        } 

        $this->redirect('/');

    }

go-login is the action of the form. So, $_POST is sent to go-login. verifyPassword is the function to verify password:

     /**
     * Verify password
     * 
     * @return true if password is correct, false otherwise
     */
    public function verifyPassword()
    {
        $users = static::findByUsername($this->username);
        if (password_verify($this->password, $users->password)) {
            return true;            
        }
        return false;
    }

findByUsername is the function to return the object user by username. And, Auth class in the go-login function creates the session:

     /**
     * Login controller
     * Set session after login
     * 
     * @param object $user 
     * @return void
     */
    public static function login($user)
    {
        session_regenerate_id();

        $_SESSION['id'] = $user->id;
    }

Every answer would be appreciated. And please let me know the other security tips as well. Thank you!!

People are also looking for solutions to the problem: php - How to customise the icon of an areablock in Pimcore

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.