Caching Roles in a Browser Cookie ................................................1256
Using the Roles Application Programming Interface .....................1258
Summary ...................................................................................................1260
Part VII Building ASP.NET Applications
28 Maintaining Application State.................................................................1263
Using Browser Cookies .............................................................................1264
Cookie Security Restrictions............................................................1265
Creating Cookies . ...........................................................................1266
Reading Cookies . ............................................................................1269
Setting Cookie Properties ................................................................1272
Deleting Cookies. ............................................................................1273
Working with Multivalued Cookies ................................................1275
Using Session State....................................................................................1279
Storing Database Data in Session State ...........................................1281
Using the Session Object . ...............................................................1284
Handling Session Events . ...............................................................1285
Controlling When a Session Times Out .........................................1287
Using Cookieless Session State . ......................................................1288
Configuring a Session State Store. ..................................................1290
Configuring SQL Server Session State .............................................1294
Using Profiles ............................................................................................1297
Creating Profile Groups...................................................................1301
Supporting Anonymous Users.........................................................1303
Migrating Anonymous Profiles .......................................................1307
Inheriting a Profile from a Custom Class .......................................1308
Creating Complex Profile Properties...............................................1310
Saving Profiles Automatically..........................................................1317
Accessing Profiles from Components..............................................1321
Using the Profile Manager...............................................................1323
Configuring the Profile Provider .....................................................1326
Creating a Custom Profile Provider ................................................1327
Summary ...................................................................................................1332
29 Caching Application Pages and Data . ....................................................1335
Overview of Caching ................................................................................1335
Using Page Output Caching .....................................................................1337
Varying the Output Cache by Parameter ........................................1338
Varying the Output Cache by Control ...........................................1342
Varying the Output Cache by Header. ...........................................1345
Varying the Output Cache by Browser ...........................................1346
Varying the Output Cache by a Custom Function.........................1347
Specifying the Cache Location. ......................................................1349
Contents
xvii