How Apache server keeps track of user session variables.
It's normally not apache's job to keep track of user session variables, but a task for your application.
Typically, all session handling is based on cookies. The web server (or web app) generates a cookie with a unique value and sends it to the client. In the following requests, the client will send that cookie back to the web server/app.
Your application then can use the value of the cookie to locally (filesystem or database) store the session variables, and associate things with a "session".