question about Sessionsate

  • Thread starter Thread starter Britt
  • Start date Start date
B

Britt

Hi,

I read that SessionState is on by default.
I also read that if it's not required, it must be better off (because of
resources)

My question is: i don't use session variables (like e.g.
Session("mysessionvar")). Is that the only way to use session state, or
there are other ways?

Thanks
Britt
 
re:
!> My question is: i don't use session variables (like e.g. Session("mysessionvar")).
!> Is that the only way to use session state, or there are other ways?

The purpose of keeping track of session state is to enable the use of session variables.

If you don't need to set session variables, you can save resources by disabling it.

The problem is that, if you do that, a new Session.SessionID will be created
every time a single page is refreshed in one browser session.

To avoid that, use url munging, by setting "cookieless" to "true" in web.config.

<sessionState mode="Off" cookieless="true" timeout="20" />

If you don't need to track someone's session by using Session.SessionID,
though, you can disregard setting "cookieless" to "true" in web.config.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top