How is session handled for multiple instances of a web application

Posted on 2012-09-17
Last Modified: 2012-09-18
Suppose I have a web application and it has a session variable named "Customer"
So Session["Customer"] = QueryStringValue;

if I have multiple instances of the web application running. Will the value for
 Session["Customer]  be different in each instance of the application running (I would hope so).

Or would their be a conflic where session variables are being overwritten by the other web application running?
Question by:brgdotnet
    LVL 21

    Accepted Solution

    Session values are unique per session???

    A session is a single browser connected to the site, so if you connect to the site from you computer using 2 different browsers you have 2 sessions open, and any session variables you store are unique within the single session they are stored in.

    When you say multiple instances of the web application, are you saying you are running the site multiple times? Or you have assigned multiple worker processes to the same site?

    One thing you do have to be careful of is if you assign multiple worker processes to the same site you have to ensure your session handler can be accessed from all work processes because different requests within the same session could go to a different worker process.

    Same thing applies with a web farm.

    LVL 5

    Assisted Solution

    I assume when you say "if I have multiple instances of the web application running.", you mean you have different browsers or browser windows open to access the web application on the client?

    Is that correct?

    if yes, then yes, you can be rest assured that the Session["Customer"] will be unique for each session that is created for each browser window.

    How it works, it that for each browser request, the web server generates a unqiue Session Id and the tracks the communciation using that. Hence, it is gauranteed to be unique.

    This is however, not true, if you are using different tabs within the same browser window.

    In that case, your session will be re-used for each tab.

    Hope that helps.
    LVL 9

    Assisted Solution

    take look at
    Session variable are maintain separately for each user on a web application so defiantly maintain separately for more than one instance of web application.

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now