Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6891559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:25:32+00:00 2026-05-27T06:25:32+00:00

I have an ASP.NET application that is using the SQLServer Session mode. I Created

  • 0

I have an ASP.NET application that is using the SQLServer Session mode. I Created the below property in my page.

internal List<string> TargetTypes
{
    get { return Session["TargetTypes"] != null ? Session["TargetTypes"] as List<string> : null; }
    set { Session["TargetTypes"] = value; }
}

Later in the page I access this property in order to add values to it as shown below

TargetTypes.Add("Value1");
TargetTypes.Add("Value2");
TargetTypes.Add("Value3");

My concern is that how the Session is managed. Does the ASP read/write to the database each time I access this property? Or is there an event that is used to save all the sessions to database?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:25:32+00:00Added an answer on May 27, 2026 at 6:25 am

    how the Session is managed?

    When Browser send request to your website then server generates a UID called sessionid and
    this ‘Sessionid’ is managed in Session Table. A table is created on the server for managing the
    session id for various web clients( Browsers).
    This session id is sent to the client. after this session is also sent to the server after first request.

    There two modes InProc and OutProc(Sql server, stateserver etc).
    Check these links for more information:
    Session State Management in Asp.net
    Session State

    When you set the <sessionState mode="SQLServer" then it saves the session values to the sql database. Follow this link to know how SessionState Works under StateServer mode.
    Fast, Scalable, and Secure Session State Management for Your Web Applications

    Does the ASP read/write to the database each time I access this
    property?

    Session state is managed by the SessionStateModule class, which calls the session-state store provider to read and write session data to the data store at different times during a request. At the beginning of a request, the SessionStateModule instance retrieves data from the data source by calling the GetItemExclusive method, or if the EnableSessionState page attribute has been set to ReadOnly, by calling the GetItem method. At the end of a request, if the session-state values have been modified, the SessionStateModule instance calls the SessionStateStoreProviderBase.SetAndReleaseItemExclusive method to write the updated values to the session-state store.
    Follow this for more details and Check SessionState Overview for your both second and third question clarification.

    Regarding your code snippet: When session start first time then all values will be null so you must check for session that is it new Session?? as you doing in Getter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have created a web application, using ASP.NET, that allows users to upload documents
I have a pretty big web application that I created last year using ASP.NET
I have an asp.net mvc2 application that is using StructureMap 2.6 and NHibernate 3.x.
I have an ASP.NET web application that is using forms authentication. Everything is configured
I have an ASP.net web service that I'm using for a web application which
I am using asp.net MVC to develop an application that will have ajax interactions.
I have an ASP.net Application that runs on the internal network (well, actually it's
I have an ASP.NET application that authenticates users using Ldap against active directory. This
I have an ASP.NET MVC 3 (using Entity Framework 4.2) application that uses transactions
First, a little background. I have two ASP.NET web applications that use SQLServer session

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.