Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 13th, 2012, 05:19 AM
Authorized User
Join Date: Feb 2007
Posts: 39
Thanks: 2
Thanked 2 Times in 2 Posts
Default Saving values in Session in case of concurrent users

Hello all,
I have a simple ASP.NET 4 application with a few pages with a forms on them where the user can insert some values.
At the bottom of each page there is a button that saves these values and redirect the user to the second page, where he can insert other values, and so on, until he reach the last 4th pages.

I'm using the Session["MyObject"] to save these values from one page to the others.
How can I be secure that, in case my application has 2 (or more) concurrent users, each user can use the correct session object?

I mean, can a second user catch the first user's session, intead of the his?
Thanks in advance.

Old February 13th, 2012, 05:28 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Hi there,

ASP.NET handles this for you. When a session is created, the user gets a cookie with the session ID which is then used to look up the session object at the server. So, each user gets his own session by design.


Imar Spaanjaars
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
Ciupaz (February 13th, 2012)
Old February 13th, 2012, 05:40 AM
Authorized User
Join Date: Feb 2007
Posts: 39
Thanks: 2
Thanked 2 Times in 2 Posts

Thanks you very much Imar, and thanks a lot to be always here :-)


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving control values Edkch BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 January 14th, 2011 03:31 AM
Problem Saving New Users Corsair BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 9 April 9th, 2009 04:54 PM
Session not working for Anonymous users songsan General .NET 0 January 4th, 2005 02:57 PM
saving shopping cart on users computer... elladi Classic ASP Basics 1 November 17th, 2004 10:03 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.