Looking at what code you provided for login.php, you didn't call session_start(). You have to call this on every page that you intend to set or retrieve $_SESSION variables.
Otherwise, if you're getting redirected (meaning your login was successful), $_SESSION['user'] and ['userid'] should work.