
186
|
Chapter 8: ASP.NET Configuration
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
The SQLServer mode requires the use of the sqlConnectionString attribute. You
should always override this attribute, since its default uses the local 127.0.0.1
loopback address and uses the SQL Server sa account to connect to the ASPState
database. Neither is a good practice in a production application. In Example 8-5
set the data source portion of the connection string to the name of the designated
SQL Server state machine and set the user ID and password to an account set up
to read and write state data.
Example 8-5 also sets the
cookieless attribute to True, anticipating that some
users may have disabled cookies. Setting this attribute to
True places the session
identifier within the URL of all requests, allowing session use without cookies.
Note that applications designed for cookieless sessions should use relative rather
than absolute URLs for internal links.
A word on security: as noted previously, the default settings for
sqlConnectionString use the SQL Server sa, or system administra-
tor, account to connect to the ASPState database. This is not a good
security practice. Instead, you should always set up a separate
account that is purpose-specific (in this case, to read and write ses-
sion state data) and use that account for connecting to the ...