It is difficult to say without knowing the specific web site.
Speaking generally you do this:
1) send HTTP request to login page with username and password encoded in the form
2) wait for the response, and see if there are cookies set within, save them apart
3) send HTTP request to your "datapage" and include the cookie in the request
In other words, HTTP connection is stateless, so the server sends a cookie to the client and expects to find that cookie in all successive requests.
My advice is to use the network inspector in Chrome (F12 key -> Network) and see how exactly how HTPP requests and responses are formed. E.g. hit F12, click "networks" then login to your site and see what happens.