Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What does the expiration problem of ASP.NET Session mean?

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Today, I will talk to you about what is meant by the expiration of ASP.NET Session, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

Always encounter ASP.NET Session expiration, and later found that directory deletion and renaming operations, must lose Session.

If you find that session is suddenly lost for no reason, and when you carefully examine the code and rule out the possibility that other routines may be lost, you may, like me, almost collapse ~!

It turns out that the problem lies in my delete operation to create a temporary directory in code and then delete it.

Now to share with you: hope to be useful for friends who encounter similar nails. no, no, no.

To put it bluntly, the essence of the ASP.NET Session expiration problem is: application restart!

When does the application restart automatically?

In other words, asp.net monitors the application directory and automatically restarts the application as soon as any monitored action occurs (such as modifying config, renaming directory, etc.)

Of course, you must have lost your session at this time.

If you can't avoid this operation (such as renaming a directory); here we can use cookie to store information or store it in the database

Note: except for the English conditions listed above. Deleting a directory must cause the ASP.NET Session to expire. Asp.net 's internal mechanism treats the directory a bit like a miser. It clings to the directory. You don't control it when you create it. Once you create it, you monitor the directory. If you want to delete or rename it (move its directory), it will restart.

After reading the above, do you have any further understanding of what the expiration problem of ASP.NET Session refers to? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report