I went to the gtsc interview yesterday. Some interviewers asked me how to check the session after it was lost.To be honest,Rarely encountered such situations until now,The only thing that comes to mind is the session timeout, and there is a session to read and write logs,I found that the interviewer was not very satisfied after hearing it,sweat!
By the way, the working principle of session in asp:
ASP sessions are process-dependent.asp session state is stored in the iis process,This is the program inetinfo.exe.So when the inetinfo.exe process crashes,This information is lost.In addition, restarting or closing the IIS service will cause loss of information.
asp.net session implementation
asp.net's session is based on httpmodule technology,httpmodule can be used before the request is processed,State control of the request,Since the session itself is used for state maintenance,Therefore, using httpmodule as the session is the most suitable.
The files in the bin directory were rewritten,asp.net has a mechanism,To ensure that the dll is recompiled,The system is running normally,It will restart the website process once,At this time, the session will be lost, so if any access database is located in the bin directory, or other files are overwritten by the system,Will cause session loss
In the folder options,If you do not open the "Open folder window in a separate process", once you create a new window,The system may think that it is a new session and cannot access the original session, so this option needs to be turned on.Otherwise it will cause session loss
It seems that most of the session loss is caused by the client,So start from the client,See if cookies are turned on
Is there a problem with the session time setting?Will it be lost due to timeout
Limit on the number of cookies in ie (20 cookies per domain) may cause session loss
Use web garden mode and use inproc mode as a way to save sessions
Tackling lost experience
1. Determine whether it is caused by cause 1. When you refresh the page every time,Track modification time of a file in bin
2. Do session read and write logs,Record each read and write session,And to record the sessionid, session value, page, current function, first
Several session operations, it will be much easier to find the cause of the loss
3. If allowed,It is recommended to use state server or sql server to save the session, so it is not easy to lose
4. Add code in global.asa to record the creation time and end time of the session,Session loss caused by timeout can be recorded in sessionend.
- Yii framework user login session loss problem solution
- php page jump session cookie missing and unable to log in
- Method to solve the problem of session loss when uploadify is used
- Full record of Apache + PHP SESSION lost resolution process under Windows
- Solve the problem of session loss after windowlocationhref
- python - you may need to restart the kernel to use updated packages error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- python 3x - typeerror: 'method' object is not subscriptable
- i want to call a child component method from a parent in vuejs
- xcode - pod install [!] no `podfile 'found in the project directory
- dart - flutter: the instance member'stars' can't be accessed in an initializer error