in reply to Reading HTTP Environment Variables from web Clients point of view

If by "HTTP Environment/Session Variables" you mean those that are available to CGI scripts, then you're going to need to set those up yourself. A web server sets these up for a CGI script in part by mapping HTTP tags to environment variables (where they'll be availabe in %ENV).

This mapping isn't done automatically on the client side. You're writing the client, so you're going to have to do this yourself (by mapping the HTTP tags you see in a response). And a web server won't respond with the same HTTP tags that a client sends (e.g., a web server won't send If-modified-since:), so you won't have quite the same information to work with.

If this isn't clear, consider the question of how the OS knows to set up environment variable based on a stream of data that your client is reading through a socket. The answer is, it doesn't.