Session timeout

E

Elliot

I put
<sessionState cookieless="false" timeout="6000"/>
in
<system.web>

However, the session["user"] defined as
session["user"] = "Peter";
sometimes is 'erased' in 10 minutes, or even in 2 minutes.

What's wrong with my code?
Thanks for your idea.
 
B

bruce barker

one of tweo issues.

1) you are using inproc sessions, and had an asp.net application recycle
(too much memory, file changes, etc).

2) you have a redirect without the session guid in the url.

-- bruce (sqlwork.com)
 
C

Cowboy \(Gregory A. Beamer\)

How are you testing the timeout? Simply surfing the site? If so, is the site
published or are you in debug mode?

What I am getting at is it is really hard to tell what is happening here. In
general, the timeout is respected, but things like server problems can kack
it. If you go to SQL State, it is a bit less problematic, if it is a server
problem, but it requires a bit more overhead in most cases (if nothing else,
adding SQL to the mix).
 
C

Cowboy \(Gregory A. Beamer\)

Not #2, as he is not using cookieless (false).


bruce barker said:
one of tweo issues.

1) you are using inproc sessions, and had an asp.net application recycle
(too much memory, file changes, etc).

2) you have a redirect without the session guid in the url.

-- bruce (sqlwork.com)


Elliot said:
I put
<sessionState cookieless="false" timeout="6000"/>
in
<system.web>

However, the session["user"] defined as
session["user"] = "Peter";
sometimes is 'erased' in 10 minutes, or even in 2 minutes.

What's wrong with my code?
Thanks for your idea.
 
S

SAL

Peter, I'm kind of wondering how to make that happen. Because in ASP.NET
2.0, VS2005 doesn't need to create the project below inetpub/wwwroot and
uses the personal webserver to debug. So, are you saying create the project
under wwwroot, open the project, place a breakpoint, hit it from another
machine and it will break on your breakpoint?
Can you expound on this further for us laymen???

Thanks
SAL

Peter Bromberg said:
In addition to the responses from Bruce and Greg, it may be advisable not
to
do your "testing" on localhost - test it from a remote machine.
--Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com


Elliot said:
I put
<sessionState cookieless="false" timeout="6000"/>
in
<system.web>

However, the session["user"] defined as
session["user"] = "Peter";
sometimes is 'erased' in 10 minutes, or even in 2 minutes.

What's wrong with my code?
Thanks for your idea.
 
E

Elliot

Maybe it's the problem that I run it in debug mode.


Cowboy (Gregory A. Beamer) said:
How are you testing the timeout? Simply surfing the site? If so, is the
site published or are you in debug mode?

What I am getting at is it is really hard to tell what is happening here.
In general, the timeout is respected, but things like server problems can
kack it. If you go to SQL State, it is a bit less problematic, if it is a
server problem, but it requires a bit more overhead in most cases (if
nothing else, adding SQL to the mix).

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box! |
*************************************************
Elliot said:
I put <sessionState cookieless="false" timeout="6000"/>
in
<system.web>

However, the session["user"] defined as
session["user"] = "Peter";
sometimes is 'erased' in 10 minutes, or even in 2 minutes.

What's wrong with my code?
Thanks for your idea.
 
C

Cowboy \(Gregory A. Beamer\)

If it runs into any errors when you are debugging, it could well be kicking
you out of session. It is not a problem, so much, that you are debugging,
but that you have an issue that cannot be solved without kicking the
session. There are not a huge number that do, but enough it is a concern.

After you finish debugging, try working the app through the same scenario
and see if it still times out quickly. If so, download Process Explorer,
from Microsoft (bought from sysinternals) and watch the asp.net worker
process for your application. Pay attention to the process number. If it
changes, you have an issue that is causing the worker process to abort.
Watch what page(s) it flips on. If you can find a common theme (always does
a flip on X page), focus on that page.


Elliot said:
Maybe it's the problem that I run it in debug mode.


Cowboy (Gregory A. Beamer) said:
How are you testing the timeout? Simply surfing the site? If so, is the
site published or are you in debug mode?

What I am getting at is it is really hard to tell what is happening here.
In general, the timeout is respected, but things like server problems can
kack it. If you go to SQL State, it is a bit less problematic, if it is a
server problem, but it requires a bit more overhead in most cases (if
nothing else, adding SQL to the mix).

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box! |
*************************************************
Elliot said:
I put <sessionState cookieless="false" timeout="6000"/>
in
<system.web>

However, the session["user"] defined as
session["user"] = "Peter";
sometimes is 'erased' in 10 minutes, or even in 2 minutes.

What's wrong with my code?
Thanks for your idea.
 
C

Cowboy \(Gregory A. Beamer\)

For the unit testing, I see nothing insidious about testing on localhost,
but I would concur that testing has to occur on a test machine prior to
deployment to production, esp. if you are causing recycling of the worker
process. While you can get around worker process flips by holding state in
SQL Server, I would not recommend a SQL state to avoid something you can
cure by finding out what is causing the flip.


Peter Bromberg said:
In addition to the responses from Bruce and Greg, it may be advisable not
to
do your "testing" on localhost - test it from a remote machine.
--Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com


Elliot said:
I put
<sessionState cookieless="false" timeout="6000"/>
in
<system.web>

However, the session["user"] defined as
session["user"] = "Peter";
sometimes is 'erased' in 10 minutes, or even in 2 minutes.

What's wrong with my code?
Thanks for your idea.
 
E

Elliot

Your ideas are highly appreciated.


Cowboy (Gregory A. Beamer) said:
If it runs into any errors when you are debugging, it could well be
kicking you out of session. It is not a problem, so much, that you are
debugging, but that you have an issue that cannot be solved without
kicking the session. There are not a huge number that do, but enough it is
a concern.

After you finish debugging, try working the app through the same scenario
and see if it still times out quickly. If so, download Process Explorer,
from Microsoft (bought from sysinternals) and watch the asp.net worker
process for your application. Pay attention to the process number. If it
changes, you have an issue that is causing the worker process to abort.
Watch what page(s) it flips on. If you can find a common theme (always
does a flip on X page), focus on that page.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box! |
*************************************************
Elliot said:
Maybe it's the problem that I run it in debug mode.


Cowboy (Gregory A. Beamer) said:
How are you testing the timeout? Simply surfing the site? If so, is the
site published or are you in debug mode?

What I am getting at is it is really hard to tell what is happening
here. In general, the timeout is respected, but things like server
problems can kack it. If you go to SQL State, it is a bit less
problematic, if it is a server problem, but it requires a bit more
overhead in most cases (if nothing else, adding SQL to the mix).

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box! |
*************************************************
I put <sessionState cookieless="false" timeout="6000"/>
in
<system.web>

However, the session["user"] defined as
session["user"] = "Peter";
sometimes is 'erased' in 10 minutes, or even in 2 minutes.

What's wrong with my code?
Thanks for your idea.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top