473,387 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Using object after it has been put in Session

I am using Session property for my own serializable objects. The code
snippet is below:

// C# ASP.NET code behind

private void btnRun_Click(object sender, System.EventArgs e)
{
MyClass myObj = new MyClass("abc", 99);

Session["key1"] = myObj;

myObj.SetValues("xyz", 123 );
myObj.m_inner = new MyClassInner("my inner obj", 555);
}

private void btnGetState_Click(object sender, System.EventArgs e)
{
MyClass myObj = (MyClass)Session["key1"];
if (myObj != null) lblData.Text = myObj.ToString();
}

It works fine in all three modes "InProc", "StateServer", "SQLServer". I
don't see any problems with modifying object after it was put in the
session. However someone mentioned that it might cause some problems. Can
anyone think of any problems with that?

Another question about how MS implements their session state management. It
looks like they keep references to all object in an internal in-proc
dictionary until the end of request and then they persist the whole
dictionary? Does anyone know details? On what event it the dictionary is
serialized?

Thanks,
A.D.
Nov 17 '05 #1
0 1003

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tom Loder | last post by:
Can anybody shed any light on this issue ??? Or even ways of temporaily getting around it ??? FISH is an ASP application which uses a WSC object called "finapps.fishapp" to handle the requests...
9
by: Greg Linwood | last post by:
I'm having difficulty understanding Session state in ASP.Net. It's almost embarrassing asking this as I've been using ASP since it was first released & it really shouldn't be this hard to use -...
2
by: Colin Basterfield | last post by:
Hi, I am confused... I have the following code in my Page_Load method private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here
4
by: The Eeediot | last post by:
Hello, folks! I am trying to design a login script / page for a set of administrative functions on my company's Intranet. I need something that is reasonably secure and I've been trying to rack...
7
by: Spencer H. Prue | last post by:
Hello!, I have a using system.web.sessionstate directive one the top of each of two web pages. On the first page I have the dataadapter, dataconnection, and dataset (also in the component tray)....
35
by: Chris | last post by:
Hi, I tried to create a class which must change the propety 'visible' of a <linktag in the masterpage into 'false' when the user is logged. But i get the error: "Object reference not set to an...
4
by: Alex | last post by:
Hello, This is a follow-up to my earlier post about having issues with our application pool recycling. We currently use Session State InProc, but if I were to choose to move the existing...
0
by: damimkader | last post by:
Hi, I'm trying to send emails using a Macro based on an Excel Sheet and the Email Client I'm using is Lotus Notes. OS used - Windows Xp. Language - VB Below is the Code I'm using for doing...
1
by: =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= | last post by:
I get the above error in some of the ASP.NET web applications on a server, and I need some help figuring out how to deal with it. This is a rather long post, and I hope I have enough details that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.