I don't think that writting "ini_set('session.auto_start', '1');" will start a session. You should use session_start() instead.
Also, you have some code errors...
You wrote $SESSION[login]... should be $SESSION["login"] or $_SESSION['login']
Also,
"echo >>> END;
....
END;"
Should be
"echo <<<END
...
END;"
Also, when you're out of a function, you don't have to write "global $variable"...
So the second line which is "global $login;" should not exist.