R
Rob Nicholson
I'm currently using InProc session which are working fine. In the app, I've
got a master object called MyApp which has a fair number of properties,
child classes etc. I find it easier to do this:
Dim MyApp As New Beer.App
Session("App") = MyApp
And then do all programming against MyApp, e.g. MyApp.Property1 = SomeValue.
Means that I can work against pure objects and not the session deep in the
business layers.
Works a treat with InProc but my host (WebHost4Life) is starting to annoy by
a) setting the idle timer on the application to just 20 minutes or b)
reducing it down even more when they feel like it the result of which is
that the application shuts down sometimes as little as 5 minutes after the
last request which means the user session also gets discarded so all their
current session settings get lost.
WebHost4Life have suggested looking at StateServer as they support that. I
understand how this works, i.e. the session state is serialised into a
binary stream and stored in a separate process.
My question is *when* does this happen. I suspect it's *not* everytime you
write to Session but at some other point in the page lifecycle. Consider:
Dim Person1 As New Beer.Person
Person1.Name = "Rob"
Session("Person") = Person1
Person1.Name = "Fred"
Dim Person2 As Beer.Person = Session("Person")
Label.Text = Person2.Name
This displays "Fred" on the screen so I'm assuming that Session("Person") is
simply setting up the usual name/value pair with a reference to Person1 and
that:
Dim Person2 As Beer.Person = Session("Person")
Is getting the same reference to Person1 back out of the Session.
So I assume the serialisation occurs at some later stage?
Cheers, Rob.
got a master object called MyApp which has a fair number of properties,
child classes etc. I find it easier to do this:
Dim MyApp As New Beer.App
Session("App") = MyApp
And then do all programming against MyApp, e.g. MyApp.Property1 = SomeValue.
Means that I can work against pure objects and not the session deep in the
business layers.
Works a treat with InProc but my host (WebHost4Life) is starting to annoy by
a) setting the idle timer on the application to just 20 minutes or b)
reducing it down even more when they feel like it the result of which is
that the application shuts down sometimes as little as 5 minutes after the
last request which means the user session also gets discarded so all their
current session settings get lost.
WebHost4Life have suggested looking at StateServer as they support that. I
understand how this works, i.e. the session state is serialised into a
binary stream and stored in a separate process.
My question is *when* does this happen. I suspect it's *not* everytime you
write to Session but at some other point in the page lifecycle. Consider:
Dim Person1 As New Beer.Person
Person1.Name = "Rob"
Session("Person") = Person1
Person1.Name = "Fred"
Dim Person2 As Beer.Person = Session("Person")
Label.Text = Person2.Name
This displays "Fred" on the screen so I'm assuming that Session("Person") is
simply setting up the usual name/value pair with a reference to Person1 and
that:
Dim Person2 As Beer.Person = Session("Person")
Is getting the same reference to Person1 back out of the Session.
So I assume the serialisation occurs at some later stage?
Cheers, Rob.