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

  • Home
  • SEARCH
  • 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 6646075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:22:18+00:00 2026-05-26T00:22:18+00:00

In Proc Session State is abadone in two casses: when Wroker Process Recycling or

  • 0

In Proc Session State is abadone in two casses: when Wroker Process Recycling or when session timeout.

I need to keep the sensitive session varaibles, where application depends on its existance.
So I have done two things.

1- Make session timeout > Form Authentication timeout.

2- Use State Server. Using State server caused a performance problem so I used Cache to increase performance.

This is a part of CRM app, where Employee search for a customer, when found, the customer is loaded to Session state, then when Employee, navigates to any page, all pages know which customer we talk about. I think this approach is better than using encrypted QueryStrings.

What do u think? Is there something I miss?

Is there a better pradigm which helps the rest of architecture more?

Thanks

 public class ContextManager : Manager
    {

        private static Customer m_Customer;

        public static void LoadCustomer(int customerID)
        {

            if (customerID <= 0)
            {
                throw new ArgumentException("customer id should be >= 0");
            }

            m_Customer = CustomerManager.FindCustomerByID(customerID);
            HttpContext.Current.Session["Customer"] = m_Customer;
        }



        public static Customer Customer
        {
            get
            {


                if (m_Customer == null) // for performance.  the code visit this place very frequently in one http request
                {
                        CheckCustomerInSession();
                        m_Customer = HttpContext.Current.Session["Customer"] as EdaraFramework.DOC.Customer.Customer;
                }

                return m_Customer;
            }
        }

        private static void CheckCustomerInSession()
        {
            if (HttpContext.Current.Session["Customer"] == null)
            {
                // Pages accepted to have a null customer are default page and customer Search
                // , Customer Edit is where LoadCustomer is called.
                if ((!HttpContext.Current.Request.Path.Contains("Default.aspx")) 
                    && (!HttpContext.Current.Request.Path.Contains("CustomerSearch.aspx")))
                {
                    m_Customer = null;
                    HttpContext.Current.Response.Redirect("~/Default.aspx");
                }
            }
        }
    }
  • 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-26T00:22:18+00:00Added an answer on May 26, 2026 at 12:22 am

    I think you might want to step back and really consider what you are doing.

    “Using State server caused a performance problem…”

    This is expected when using out of process sessions that are not stored in your web servers memory. Incidentally, it’s one of the top reasons why I always advocate just shutting session off.

    When you start adding web servers, session really breaks down. Further, most people tend to store a LOT of stuff in session not realizing that the servers have to spend time serializing and deserializing session data even when it’s not used on the pages in question. When this data is stored on a third server in order to support web farms, the time spent is radically increased due to all of the network traffic. Further you go from a single failure point (the one web server) to multiple failure points (network, switch, cables, state server, etc).

    See if you can just get rid of the session dependency entirely and move to using an encrypted ID in your query strings for grabbing customer details. Of course, you still need to validate that the user account has access to those customer details, but you should be doing that anyway.

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

Sidebar

Related Questions

Because of some In Proc problems I try to switch to SQL State session.
I have a stored proc on an existing 3rd party application (SQL 2005) that
We've implemented Fluent NHibernate, but we have a need to execute a stored proc
I have an asp.net application running in a server farm. So In-proc sessions are
Executing locally in a clean session: %let x = %str(put(age, best.)); proc sql; select
I keep running into stale, locked, (php) session files on my apache server which
In my current asp.net application, i'm storing the session variables in the SQL server
Is it possible to implement SQL Session State with ASP.NET MVC without the addition
I am currently working on session timeout. During inactivity in my page for a
Create Proc CrearNuevoAnuncio @Titulo varchar(250), @Precio int, @Descripcion varchar(250), @IDCategoria int, @IDImagen int, @Login

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.