Skip to main content
Visual C++ Samples 
SessionSettings Sample: Session State Demonstration 

Download sample

Demonstrates how to use session state to maintain user preferences across multiple client requests.

The SessionSettings sample takes the form of a simple photo gallery, with images that can be displayed either in actual size or scaled, and in high, medium, and low resolutions. Visitors to the photo gallery can specify the desired settings through an HTML page, and submit these preferences to the server. The settings are stored using ATL Server's session state support, where they remain available for use in responding to subsequent HTML requests from the gallery pages.

This sample shows how to:

  • Maintain user preferences across multiple HTML requests.

  • Add session state support to an ATL Server extension DLL.

  • Use either memory or database support to store session state data.

Security noteSecurity Note

This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended.

Requirements

  • IIS

Building and Running the Sample

To build and run this sample

  1. Open the solution file, SessionSettings.sln, in the Visual Studio development environment.

  2. Build the solution. This will also deploy the solution to the local Web server.

  3. Use a Web browser to view http://localhost/sessionsettings/gallery.srf.

Demonstrates

See Also