Asp.net IIS session loss session key loss

Source: Internet
Author: User

Tired! How many Google articles to find a solutionArticleThe number of pages browsed. I have prepared my Asp.net project two days ago and I am very happy to publish the project. I was shocked when I launched the test on the server !! Enter the correct account and password on the logon page, and then return to the logon page in less than 3 seconds after entering the main form! It is impossible. In this case, the logon interface is returned only when the page session is empty.

I don't think so! So I tested the source code on a local machine. It's okay. The session value on every page exists! I suspect that an error occurred during the release, so I published it again. But it still does not work. What is the error! Because my meal project no longer uses previous template pages, it is implemented using the frame framework. So Google: the solution to session loss in IFRAME. A lot of solutions are found after reading them.

① Add response. addheader ("p3p", "cp = CaO PSA our") to the session Writing Page ");

② Solutions for session loss in IFRAME during development, we often encounter frame-based work, and sometimes it is used to integrate with other websites and apply it to multiple domains, IFRAME cannot save the session. Therefore, you can find many related articles on the Internet. If the website can use the settings in Web. config:

<Sessionstate mode = "StateServer" stateconnectionstring = "TCPIP = 127.0.0.0.1: 42424"
Sqlconnectionstring = "Data Source = 127.0.0.1; trusted_connection = yes" cookieless = "false" timeout = "40"/>
Change cookieless = "false" to "true. But there is also a small problem, that is, if the page uses the Javascript window. Location. href = '',

The system will consider this as another new request and generate a new sessionid, resulting in the same loss of the original session. So for redirection

, It is better to use response. Redirect ()

③ Besides the session loss problem in ifrmae, frameset also has the same problem. Frameset problems are more specific, sometimes lost, and sometimes not lost. This is a headache. I found a method on the Internet and added a statement in page_onload on the page: response. addheader ("p3p", "cp = CaO PSA our ");

 

Wait, and many others will try it one by one! At the beginning, I was very confident. When a test failed, it was really annoying! Something is ready but not usable! Why should we punish me like that! During this time, I had a bad temper. You still want to give up !! It's no problem to write data to the background. It was not very in-depth before it was released, but no one can help now. I feel helpless !!

I always thought it was a Program error. I think there is no problem with IIS configuration! Haha, after such a torment, I was forced to turn to IIS. I also suddenly saw an article about Windows + IIS6 + ASP (ASP. NET) on Google's n web pages. After reading this article, I really felt like a different village! It turned out to be an error in this program pool! Iis6.0 ah, haha, It's really killing me!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.