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 177737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:06:26+00:00 2026-05-11T14:06:26+00:00

I am using sessionstate stored in stateserver in asp.net. I have a link on

  • 0

I am using sessionstate stored in stateserver in asp.net. I have a link on header that displays users login id.

Problem:

When session expires in stateserver my application still displays loginid and it throws an error when hits code that depends on value stored in session.

Looks like asp.net has no idea when session expires on stateserver and continue working on same session with value saved in cookie in user’s browser.

To tackle this problem in another application i am checking for session with each request and expire user’s session if it’s expired in sessionstate.

I am not sure i am doing right thing here. Isn’t asp.net suppose to keep session data saved in cookies synced with session in stateserver?

Could you please explain what would be best practice to handle this?

  • 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. 2026-05-11T14:06:26+00:00Added an answer on May 11, 2026 at 2:06 pm

    If you are using ASP.Net Webforms, you can consider the Load event of the page or control to check whether the session has expired. Here’s the relevant code

    if(Session['yourvar'] == null)   ShowError(); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using ASP.NET, with session state stored out of process in SQL Server. When
we are using asp.net 2.x, we use session state stored in sql server, 2
First, a little background. I have two ASP.NET web applications that use SQLServer session
I've got a load-balanced (not using Session state) ASP.Net 2.0 app on IIS5 running
Using ASP.NET MVC there are situations (such as form submission) that may require a
I've got an ASP.Net project that uses session state, I'd like to be a
I have a static class in my ASP.NET app that I use to hold
I am trying to pass data between two pages using Session State in ASP.NET.
i would like a working example, that uses a asp.net session state server, to
I'm working on a Web project using Asp.Net MVC, which I'll have to deploy

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.