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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:28:02+00:00 2026-05-11T09:28:02+00:00

I have an ASP.NET application that uses Session.SessionID to prevent multiple users viewing the

  • 0

I have an ASP.NET application that uses Session.SessionID to prevent multiple users viewing the same data at the same time.

I have a table that contains a set of images (stored in BLOB) that require processing. Only one user is supposed to be able to view the same image at the same time. To achieve this, as each record is retrieved by a user the record is updated with the Session.SessionID. This update occurs inside a ReaderWriterLock.

I have done a test to ensure the ReaderWriterLock is working correctly and can confirm that only one session can execute the code inside that block at once.

My current theory is that two different users are getting the same SessionID at the same time. A user of this application is allowed to view records they have locked or any unlocked images.

I have modified the application to display the SessionID in the footer of every page so that if the problem happens again I can check the SessionID value.

I’ve seen some articles online suggesting that SessionID is not unique and some saying that the SessionID is unique. I understand that SessionID is not unique forever but can the SessionID value be considered unique for active sessions?

This forum describes a similar problem

I have also read some suggestions that a Guid should be stored in the Session object and used as a unique ID instead of the Session ID.

Thanks for the responses so far. Here is a clarification based on the answers so far:

‘Locked forever’ – we prevent this by a lock timeout of 5 minutes. Before a user locks an image, while inside the ReaderWriterLock, we do a ‘cleanup’ of old locks (which unlocks images locked for more than 5 minutes), a query to get the oldest unlocked image and an update statement to ‘lock’ that image to the current session.

A possible cause of the problem would be if one user ‘locks’ an image but then leaves the PC for a short break. If they did nothing for 5 minutes, that image on there screen would be unlocked and potentially opened by another user. I mentioned this scenario when the problem was reported and I was assured that the users had been working continuously.

‘Different Window/Tab’ – I haven’t actually seen the error with my own eyes but the person who reported the problem has told me that it is two different PC’s and two different usernames of the logged in user.

Hopefully now that I am displaying the Session ID on the page, next time it happens I will be able to say with certainty whether it is the same Session ID on two machines or if it is some other problem. This issue has never occurred during the testing phase so it appears to be a symptom of a larger number of concurrent users.

Thanks for the responses so far and I will update this question as more information comes to hand.

It seems that the user didn’t give me the full story. Session ID is unique in our case as per the accepted answer. Two users were able to see the same image at the same time because user 1 was idle for the 5 minute ‘abandoned image’ unlock process. The ‘abandoned image’ timeout has been raised to match the session timeout to avoid this problem.

  • 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-11T09:28:03+00:00Added an answer on May 11, 2026 at 9:28 am

    This link says session ids are unique – http://support.microsoft.com/kb/899918

    Session ids are unique in that only 1 session will ever have that id at any given time.

    If this wasn’t the case I think there would be a lot of people shouting very loudly about it.

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

Sidebar

Ask A Question

Stats

  • Questions 156k
  • Answers 156k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Oh, I get it. I have found these code snippet… May 12, 2026 at 10:57 am
  • Editorial Team
    Editorial Team added an answer Welcome to the universe of C++! For your question, the… May 12, 2026 at 10:57 am
  • Editorial Team
    Editorial Team added an answer Can this be done using DNS configuration? Yes. You can… May 12, 2026 at 10:57 am

Related Questions

Here is my current question: I'm guessing that my problem (described below) is being
I have an existing asp.net webforms project that uses Microsoft's Enterprise DAAB for the
I have an ASP .NET website that uses cookieless sessions. When the initial request
I am currently working on an web application that uses ASP.NET 2.0 framework. I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.