.NET Forum / ASP.NET / General / December 2007
Session timeout
|
|
Thread rating:  |
Elliot - 18 Dec 2007 16:35 GMT 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.
bruce barker - 18 Dec 2007 17:07 GMT 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)
> I put > <sessionState cookieless="false" timeout="6000"/> [quoted text clipped - 7 lines] > What's wrong with my code? > Thanks for your idea. Cowboy (Gregory A. Beamer) - 18 Dec 2007 17:23 GMT Not #2, as he is not using cookieless (false).
 Signature Gregory A. Beamer MVP, MCP: +I, SE, SD, DBA
*************************************************
| Think outside the box! *************************************************
> one of tweo issues. > [quoted text clipped - 16 lines] >> What's wrong with my code? >> Thanks for your idea. Cowboy (Gregory A. Beamer) - 18 Dec 2007 17:13 GMT 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).
 Signature Gregory A. Beamer MVP, MCP: +I, SE, SD, DBA
*************************************************
| Think outside the box! *************************************************
>I put <sessionState cookieless="false" timeout="6000"/> > in [quoted text clipped - 6 lines] > What's wrong with my code? > Thanks for your idea. Elliot - 19 Dec 2007 13:01 GMT Maybe it's the problem that I run it in debug mode.
> How are you testing the timeout? Simply surfing the site? If so, is the > site published or are you in debug mode? [quoted text clipped - 17 lines] >> What's wrong with my code? >> Thanks for your idea. Cowboy (Gregory A. Beamer) - 19 Dec 2007 16:19 GMT 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.
 Signature Gregory A. Beamer MVP, MCP: +I, SE, SD, DBA
*************************************************
| Think outside the box! *************************************************
> Maybe it's the problem that I run it in debug mode. > [quoted text clipped - 19 lines] >>> What's wrong with my code? >>> Thanks for your idea. Elliot - 20 Dec 2007 17:48 GMT Your ideas are highly appreciated.
> 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 [quoted text clipped - 35 lines] >>>> What's wrong with my code? >>>> Thanks for your idea. Peter Bromberg [C# MVP] - 18 Dec 2007 18:22 GMT 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
> I put > <sessionState cookieless="false" timeout="6000"/> [quoted text clipped - 7 lines] > What's wrong with my code? > Thanks for your idea. SAL - 18 Dec 2007 23:28 GMT 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
> In addition to the responses from Bruce and Greg, it may be advisable not > to [quoted text clipped - 15 lines] >> What's wrong with my code? >> Thanks for your idea. Cowboy (Gregory A. Beamer) - 19 Dec 2007 16:21 GMT 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.
 Signature Gregory A. Beamer MVP, MCP: +I, SE, SD, DBA
*************************************************
| Think outside the box! *************************************************
> In addition to the responses from Bruce and Greg, it may be advisable not > to [quoted text clipped - 15 lines] >> What's wrong with my code? >> Thanks for your idea.
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|