SessionSettings Sample: Session State Demonstration
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.
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.
Building and Running the Sample
To build and run this sample
Open the solution file, SessionSettings.sln, in the Visual Studio development environment.
Build the solution. This will also deploy the solution to the local Web server.
Use a Web browser to view http://localhost/sessionsettings/gallery.srf.
ISession | ISessionStateService | ISessionStateControl | CSessionStateService | ISession::SetVariable | ISession::GetVariable | ISessionStateService::CloseSession | ISessionStateService::CreateNewSession | ISessionStateService::GetSession | HttpResponse::Redirect | CMemSessionServiceImpl | CDBSessionServiceImplT