The following cookies and session variables are used in the Web application:
Cookies
Session Variables
In addition the store uses several Session variables. The Web Store requires Sessions to be enabled and we highly recommend that you use either the ASP.NET State Server or Sql Storage to ensure that a restarted server or application can persist sessions properly. By default the store ships with InProc sessions so it runs out of the box, but it's highly recommended to use SessionServer:
<configuration>
<system.web>
<sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424"
cookieless="false" timeout="60" />
</system.web>
</configuration>
The Web Store doesn't make extensive use of Session variables. Most of the operational data is tracked in database files. The values stored in the session are mainly ID values and a few cumulative opeational values that are frequently needed. The following is the complete list of Session keys used:
- CustPk
Once a customer profile is accessed the CustPk session id is set and identifies the customer's pk. This is used to seed invoice data with the PK without having to force a lookup on the Customer object and is used to recycle customer Pks. - InvPk
Once a user starts adding items to the shopping cart he's assigned an invoice Pk. This Pk is carried forward and eventually used on the invoice that is placed for the final order. Also useful to check whether the user has entered any items into his shopping cart yet. - ShoppingCartItems and ShoppingCartSubTotal
Keeps track of items in the shopping cart. Updated whenever items are displayed on the ShoppingCart page. - ShippingAddressPk
Flag used during the final order process to identify if a special shipping address is used. The PK maps the shipping address stored on disk. It is discarded after the order is placed and the shipping address attached. - ShippingInfo Object
This object is used to track the users shipping options throughout the application while shopping. There's a need to keep track of this info over several requests because orders are not finalized and written to disk until the final order button is pressed. Until that point no permanent data is written and so the shipping options are carried forward from previous forms. This object contains fields for shipping location, Shipping method, whether shipping is required and more. It maps to the ShippingInfo business utility class.