Print service provided by iDogiCat: http://www.idogicat.com/
home logo





Home > IT > Programming > CGI Session Management

CGI Session Management

Session management is a way to identify a user in several HTTP requests. Usually this is done by assigning an identifier to a user, and make the user pass it every time the user makes a HTTP request, so that the web application can figure out from whom the request is from according to the identifier. Typical examples of using session management includes forum and shopping cart.

Since connection to a web server is only from the request to the response, HTTP itself doesn't support session management.

Using cookies is one way to keep track of a user. Cookies can be set and retrieved using CGI, as well as JavaScript. But the latter is not recommended, since anyone can see the code, and JavaScript doesn't have much access to server side resources. Cookies can be handled easily using CGI.pm.