How to resolve settings session save after StateServer cause Webservice/webmethod cannot get session asynchronously

Source: Internet
Author: User

There is a file upload function in the project, you need to display the file upload progress. The Webservice/webmethod is then called with Pagemethods.

Test everything normally in the demo. However, you cannot asynchronously refresh the file upload progress after moving to the project.

After debugging, it is found that the session information is not up-to-date when the File upload page is updated because of asynchronous refresh.

also found in Web. config is the following settings

<sessionstate mode= "StateServer" stateconnectionstring= "tcpip=localhost:42424" cookieless= "false" timeout= "30"/ >

The asynchronous flush works correctly after the comment is dropped, so it concludes

Setting session saved after StateServer caused Webservice/webmethod unable to get session asynchronously

However, when commented out, it causes the session to be lost unexpectedly.

Find a variety of materials have not found a way to solve.

And then accidentally remembered the application can also store objects

So: Replace session with Application

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.