It looks like this function is apart of a family of classes that do this:
This method should be used to retrieve the environment variables that will be needed to 'validate' a session.
This is so stupid it hurts. When your session is hijacked using XSS it will probably be sent as a GET request. In the incoming HTTP request will contain the USER_AGENT, as well as many other "environment variables" that the attacker can control.
Calling this approach a waste of time is an understatement. This is not a security feature, and sessions are can never be protected in this way.
If you want to protection your sessions scan for xss, patch CSRF, use https for the entire session. Read the OWASP top 10 for 2010, especially A3: "Broken authentication and session management."