What are common issues when implementing a login system in PHP?

Issue: One common issue when implementing a login system in PHP is not securely storing user passwords. To solve this, it is recommended to hash the passwords using a strong hashing algorithm like bcrypt.

$password = "user_password";
$hashed_password = password_hash($password, PASSWORD_DEFAULT);
```

Issue: Another common issue is not protecting against SQL injection attacks. To prevent this, it is important to use prepared statements when querying the database.

```php
$username = $_POST['username'];
$password = $_POST['password'];

$stmt = $pdo->prepare("SELECT * FROM users WHERE username = :username AND password = :password");
$stmt->bindParam(':username', $username);
$stmt->bindParam(':password', $password);
$stmt->execute();