Session state or global?

Discussion in 'ASP.NET / ASP.NET Core' started by reiji, Jun 24, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. In order to pass data from one page to another, I have used both session state and global variable to make it work. However, I feel uncomfortable with either approach.

    Could someone offer some pros and cons for either methods? Is there another way(s) to pass data between pages?

    Thanks.

    - reiji
     
  2. quote:Originally posted by reiji

    In order to pass data from one page to another, I have used both session state and global variable to make it work. However, I feel uncomfortable with either approach.

    Could someone offer some pros and cons for either methods? Is there another way(s) to pass data between pages?
    </blockquote id="quote"></font id="quote">

    You can pass data in hidden fields or through the URLString (http://SomeHost.com/SomePage.aspx?MyVar=100) Look at the Request object for the syntax of how to retrieve it. There's no reason to feel uncomfortable about using session (anymore), but you should try not to store things that are too large in session. For instance, don't store your entire user database in there. Store things that are relevant to the current user's session.
     
  3. I Just started using session state and I was wondering if there is a good way to trap session timeout . .So far I just get server errors when the session times out
     
  4. See the "Loss of Session" topic in this section.

    quote:Originally posted by Swood

    I Just started using session state and I was wondering if there is a good way to trap session timeout . .So far I just get server errors when the session times out
    </blockquote id="quote"></font id="quote">

    Rollins
    RollinsTurner.com
     
  5. There are nine ways according to microsoft documentation all have their drawbacks and benefits. I suggest you look at each one and determine for the data you are using which one to use, you should use multiple methods throughout your web application to increase performance, some methods tailor better for large chunks while some tailor better for smaller.

    msdn.microsoft.com/msdnmag/issues/03/04/ASPNETUserState/default.aspx
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page