From: Brian Cryer on
"Brian Cryer" <not.here(a)localhost> wrote in message
news:OsBP$0%23JLHA.6100(a)TK2MSFTNGP05.phx.gbl...

Two suggestions:

1. Are you calling session.abandon anywhere?

2. Are you resetting the session timeout anywhere? (Not sure if this works
with state-server anyway, but worth asking the question.)

3. Are you running in a web-garden or web-farm environment? A web-garden is
multiple cpus [not cores], but I don't think a web-garden will cause
problems. A web-farm is where you have multiple servers, in this case you
there is a little bit of extra config to ensure that they each use the same
state and don't have the information pertitioned on the state-service on a
per-machine basis - see
http://support.microsoft.com/default.aspx?scid=kb;en-us;325056 for details.
--
Brian Cryer
http://www.cryer.co.uk/brian

From: Mr. Arnold on
On 7/20/2010 5:32 AM, Brian Cryer wrote:
>
> "Mr. Arnold" <Arnold(a)Arnold.com> wrote in message
> news:%23DOd7z%23JLHA.3732(a)TK2MSFTNGP02.phx.gbl...
>> On 7/20/2010 5:10 AM, Brian Cryer wrote:
>>> "Mr. Arnold" <Arnold(a)Arnold.com> wrote in message
>>> news:u7$DQp%23JLHA.1868(a)TK2MSFTNGP05.phx.gbl...
>>>> On 7/20/2010 4:54 AM, JK wrote:
>>>>> 3P a �crit :
>>>>>> Are You saving/deleting any files under Your website's folder
>>>>>> structure.
>>>>>>
>>>>>> Add logging application restarts to global.asax.
>>>>>
>>>>> I have no global.asax.
>>>>> However, when running state server, is that important ?
>>>>> I've read somewhere that unless you restart state server, you never
>>>>> lose
>>>>> sessions variables.
>>>>>
>>>>
>>>> But how would an application know about the session variables it had
>>>> when W3WP.exe was recycled?. Everything is lost I would think. And
>>>> that must be the case, because you're talking about even with a
>>>> session start server in the infrastructure.
>>>
>>> All variables are lost yes, but not session unless you are using
>>> in-proc. With state-server the session information is serialized and
>>> stored in a separate asp.net state server process. The session ID is
>>> stored in a cookie (I think), so is available to the server on each
>>> post-back or page-refresh, and it uses this to retrieve session
>>> information from the asp.net state server process. So session
>>> information is preserved across a recycle (which can be very useful when
>>> debugging as you can compile and then continue without having to
>>> re-login).
>>
>> But if the session is lost by the application how is IIS going to know
>> what session information belonged to what application? I don't think
>> IIS is doing application tracking too with a state server. Now maybe,
>> the programmer can take over and program for it in the application and
>> go after the state information and restore it.
>>
>> But without doing that, I don't see how it's going to get session back
>> for the application without some type of intervention initiated by the
>> application itself.
>
> Sorry I thought I explained that. The session-id is sent to the browser,
> normally in a cookie. It is then posted back to the server on every
> post-back or page-refresh. So the server (by which I mean the asp.net
> framework running on the server, not IIS which couldn't care less)
> always has the session-id. So the session-id is always available. The
> session-id is then used when the asp.net state service is contacted to
> retrieve the session information.
>
> That is how session information is preserved across a recycle.

>
> Now, if you use in-proc then the session information would be stored in
> the worker process so if the worker process were recycled then the
> session information would be lost. The OP is using state-server so the
> session information is stored externally to the worker process and thus
> is preserved across a recycle.
>
> Does that help clarify things?

But what you're talking about is based on using a cookie. What if the
application is not using cookies then what?
From: JK on
Brian Cryer a �crit :
> "Brian Cryer" <not.here(a)localhost> wrote in message
> news:OsBP$0%23JLHA.6100(a)TK2MSFTNGP05.phx.gbl...
>
> Two suggestions:
>
> 1. Are you calling session.abandon anywhere?
>
> 2. Are you resetting the session timeout anywhere? (Not sure if this
> works with state-server anyway, but worth asking the question.)
>
> 3. Are you running in a web-garden or web-farm environment? A web-garden
> is multiple cpus [not cores], but I don't think a web-garden will cause
> problems. A web-farm is where you have multiple servers, in this case
> you there is a little bit of extra config to ensure that they each use
> the same state and don't have the information pertitioned on the
> state-service on a per-machine basis - see
> http://support.microsoft.com/default.aspx?scid=kb;en-us;325056 for details.


Hi Brian,

Answer is No for 3 questions.

I just had an idea and I'm doing some testing to validate.

My session variable is a Custom Object we created.
If, for any reason, the application is being recompiled, maybe the
object stored in state server will be lost.
I'm tyring to see whether simple variables (e.g Integers) are also lost.

Thanks for all,
JM



From: Brian Cryer on
"Mr. Arnold" <Arnold(a)Arnold.com> wrote in message
news:eHHfz$%23JLHA.1016(a)TK2MSFTNGP06.phx.gbl...
> On 7/20/2010 5:32 AM, Brian Cryer wrote:
>>
>> "Mr. Arnold" <Arnold(a)Arnold.com> wrote in message
>> news:%23DOd7z%23JLHA.3732(a)TK2MSFTNGP02.phx.gbl...
>>> On 7/20/2010 5:10 AM, Brian Cryer wrote:
>>>> "Mr. Arnold" <Arnold(a)Arnold.com> wrote in message
>>>> news:u7$DQp%23JLHA.1868(a)TK2MSFTNGP05.phx.gbl...
>>>>> On 7/20/2010 4:54 AM, JK wrote:
>>>>>> 3P a �crit :
>>>>>>> Are You saving/deleting any files under Your website's folder
>>>>>>> structure.
>>>>>>>
>>>>>>> Add logging application restarts to global.asax.
>>>>>>
>>>>>> I have no global.asax.
>>>>>> However, when running state server, is that important ?
>>>>>> I've read somewhere that unless you restart state server, you never
>>>>>> lose
>>>>>> sessions variables.
>>>>>>
>>>>>
>>>>> But how would an application know about the session variables it had
>>>>> when W3WP.exe was recycled?. Everything is lost I would think. And
>>>>> that must be the case, because you're talking about even with a
>>>>> session start server in the infrastructure.
>>>>
>>>> All variables are lost yes, but not session unless you are using
>>>> in-proc. With state-server the session information is serialized and
>>>> stored in a separate asp.net state server process. The session ID is
>>>> stored in a cookie (I think), so is available to the server on each
>>>> post-back or page-refresh, and it uses this to retrieve session
>>>> information from the asp.net state server process. So session
>>>> information is preserved across a recycle (which can be very useful
>>>> when
>>>> debugging as you can compile and then continue without having to
>>>> re-login).
>>>
>>> But if the session is lost by the application how is IIS going to know
>>> what session information belonged to what application? I don't think
>>> IIS is doing application tracking too with a state server. Now maybe,
>>> the programmer can take over and program for it in the application and
>>> go after the state information and restore it.
>>>
>>> But without doing that, I don't see how it's going to get session back
>>> for the application without some type of intervention initiated by the
>>> application itself.
>>
>> Sorry I thought I explained that. The session-id is sent to the browser,
>> normally in a cookie. It is then posted back to the server on every
>> post-back or page-refresh. So the server (by which I mean the asp.net
>> framework running on the server, not IIS which couldn't care less)
>> always has the session-id. So the session-id is always available. The
>> session-id is then used when the asp.net state service is contacted to
>> retrieve the session information.
>>
>> That is how session information is preserved across a recycle.
>
>>
>> Now, if you use in-proc then the session information would be stored in
>> the worker process so if the worker process were recycled then the
>> session information would be lost. The OP is using state-server so the
>> session information is stored externally to the worker process and thus
>> is preserved across a recycle.
>>
>> Does that help clarify things?
>
> But what you're talking about is based on using a cookie. What if the
> application is not using cookies then what?

Don't know. It could store it as a separate variable in the HTML much like
viewstate or even in the viewstate, but I'm speculating because I don't know
what asp.net does. This isn't something I've looked at.

If something (like not using cookies) interferes with the session-id so its
lost then yes that could account for what the OP is seeing - which is why
I've posted suggesting he look at whether the session-id is preserved when
the session is lost.
--
Brian Cryer
http://www.cryer.co.uk/brian

From: JK on
Mr. Arnold a �crit :
>>
>
> But what you're talking about is based on using a cookie. What if the
> application is not using cookies then what?


I think you should read the Microsoft documentation on this.
All is explained.

JM