Much better to send modes via query string in URL (as
noted above) if you can.
Session state can be tricky to work with for these reasons:
1. IIS may start up more than one worker process,
called aspnet_wp.exe, and unless you set up your
Sessionstate XML block in web.config properly every
time a different aspnet_wp.exe process handles a
web request from the same user a new session will be
started, and you
will loose previous session state variables. This can
be avoided by using Microsoft's State Server that comes
with XP Pro, or saving state to MS SQL Server.
2. If you are eventually going to use a web farm, session state
must be managed across the entire garden, which means
you will have to use either State Server, SQL Server, or
something similar to save session state amongst all the
web boxes, or else every time the request gets routed to
a new box/process you will loose state.
3. Having to save and restore session state to State Server
or SQL server is much slower than if you just send your
form modes to the next web page via query string.
4. Finally, as previously noted above, Session state requires
memory, which is OK for small sites, but can quickly
add up for highly-trafficed sites.
Use Session state as a last resort, or when security
requires that you don't expose the information. Or
consider writing your state information to a fast DB.
I use MS State Server so my SessionState XML looks
like this:
<sessionState
mode="StateServer"
stateConnectionString="tcpip=xxx.xxx.xxx.xxx:42424 "
/>
I believe the default setup for sessionState is inProc,
which means if you have more than one aspnet_wp.exe
process running session state will eventually get hosed.