When someone logs in to my site, they obviously fill out a form with username and password. The form then checks if that exists in the database (the encrypted version of that password of course), and then starts a session with that person's user ID as the session ID.
Is this prone to any kind of spoofing/hijacking/hacking? Is there a safer way to do sessions so that no one can "log into someone elses account" by mistake?
session_regenerate_id();
$_SESSION['SESS_MEMBER_ID'] = $uid;
$_SESSION['SESS_NAME'] = $email;
session_write_close();