An attacker cannot easily modify or read $ _SESSION variables if there is no other vulnerability, but usually the wrong practice is to keep the password longer than necessary on the server, for several reasons.
It is enough to check the password once when the user logs in. After that, you only need to save the authenticated user_id in the session. You need to know who the session belongs to, grant the necessary permissions to this particular user. But you already know that the user sent the correct password, otherwise you would not have saved his user_id in the session in the first place.
source share