Microsoft Knowledge Base Email Alertz

KBAlertz.com: How to maintain the ASP.NET session state

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 932474 - Last Review: February 16, 2007 - Revision: 1.1

How to maintain the ASP.NET session state

INTRODUCTION

The Microsoft ASP.NET session state is process-dependent. Anything that affects the process may result in a lost session state. This article discusses how to maintain the ASP.NET session state.

MORE INFORMATION

The following are two common scenarios in which the session may behave unpredictably:
  • When you click a hyperlink in an application that is hosting the WebBrowser control, a new page opens in Internet Explorer. In this scenario, the session cookie is lost, and you may have to log on again. This behavior occurs because Internet Explorer is a different process than the application process. A session cookie cannot be shared between processes.

    To maintain the session state in this scenario, you can use the NewWindow2 event to open the new page in another form in the application. This event is triggered by the WebBrowser control. For more information about how to use the NewWindow2 event, click the following article number to view the article in the Microsoft Knowledge Base:
    311282  (http://kbalertz.com/Feedback.aspx?kbNumber=311282/ ) How to use the WebBrowser control NewWindow2 event in Visual Basic .NET
  • You open an ASP.NET-connected application in Internet Explorer. The application sends a Microsoft Outlook e-mail message that contains a hyperlink. In this scenario, you assume that the application will obtain a new session when you click the hyperlink in Outlook. However, Outlook uses the same session as the ASP.NET-connected application uses. This behavior occurs because the new page that is opened in Internet Explorer uses the existing Internet Explorer process instead of creating a new process. This behavior is by design because using an existing process saves resources and time.

    To maintain the system state in this scenario, you can use a query string to store the state of the application. For more information about how to store a state in an active server pages application, click the following article number to view the article in the Microsoft Knowledge Base:
    175167  (http://kbalertz.com/Feedback.aspx?kbNumber=175167/ ) How to store state in Active Server Pages applications

REFERENCES

For more information about the ASP.NET session state, visit the following Microsoft Web site:
http://msdn2.microsoft.com/en-us/library/ms972429.aspx (http://msdn2.microsoft.com/en-us/library/ms972429.aspx)

APPLIES TO
  • Microsoft ASP.NET 2.0
  • Microsoft ASP.NET 1.0
Keywords: 
kbinfo kbhowto KB932474
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Anonymous User Report As Irrelevant  
Written: 7/1/2008 5:08 AM
1223456

bvnbvnvbn()&*&()))))(*&%$#@# - vnbbv$#$$%$^%% Report As Irrelevant  
Written: 10/8/2008 4:16 AM
!@#$%%^&*****&*^& nbvnnbvn@#$%^^&*()

Karry Report As Irrelevant  
Written: 11/11/2008 3:16 AM
Reffer http://msdn.microsoft.com/en-us/library/z1hkazw7.aspx

Jarek - http://www.jestemdobry.pl Report As Irrelevant  
Written: 2/3/2009 8:42 AM
More examples would be great

Anonymous User Report As Irrelevant  
Written: 5/13/2009 2:05 AM
<td>

Anonymous User Report As Irrelevant  
Written: 5/20/2009 2:54 AM
sd

Anonymous User Report As Irrelevant  
Written: 7/1/2009 4:06 AM
hkjhk

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please