I'm attempting to send an HTTP GET request to a 3rd party (not-under-my-control) web server with Node.js (using the request npm module) and am being redirected by the server to a log-in page. It refuses to send the page because I'm not logged in.

Since the redirect can't be happening on the client-side (I'm requesting the page, not parsing it), I don't understand how the web server can be checking local data or cookies to see whether or not I (my HTTP GET request) is logged in *before* deciding whether or not to send me the page.

**My Question**

In what way(s) can a web server potentially check whether or not to redirect a GET request on an existing page, *before* responding to the request?

**My Code**

```
var request = require('request');

function checkUsername(username) {

    request({
        uri : "http://www.kongregate.com/accounts/" + username + "/recently-played",
        method : "GET",
        timeout : 10000,

        //in order to avoid being redirected to the login page, I've used:
        followRedirect : false,
        maxRedirects : 0
    }, function(error, response, body) {
        if (error)
            console.log("Player does not exist");
        else {
            console.log("Player exists!");
            }
        }
    });

}

checkUsername("jonathan_t0dd");

```

This avoids a successful redirect, but serves the html:

```
<html><body>You are being <a href="http://www.kongregate.com/session/new">redirected</a>.</body></html>

```

I would like to understand this scenario in a way that might allow me to understand how I can offer the server any data that it might require for successful serving of the asset that I'm requesting.