Click here to Skip to main content
15,886,046 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have hosted an application in IIS, In that application am having a folder called "inputfiles", while executing a job in that application, a folder with job number will be created inside "inputfiles" folder, which is inside the application. This newly created folder contains some input text files, after completing the job, the newly created folder which contains the input text files will be deleted. Immediately after the deletion the session is getting cleared, asking the user to login again..

why the session is getting cleared? and please provide me with a solution to over come this problem.
Posted
Comments
ZurdoDev 9-Oct-15 8:15am    
IIS sees disk changes and reloads the app pool. You could always store the files outside of the path of the web files.
sindhu19 9-Oct-15 8:53am    
Instead of putting the file outside the application, do we have any other solutions?
ZurdoDev 9-Oct-15 8:57am    
There is because our app works fine and we can delete files stored in our upload folder. I can't recall if we had to do anything specific though.

You could, of course, use the Session State Service or Sql Server for your session instead of InProc. That would work, I believe. IIS still restarts the app pool but your session is maintained.

Otherwise, google for IIS and disk changes and what else there is.
Richard Deeming 9-Oct-15 9:07am    
Deleting files shouldn't cause the AppPool to recycle, but deleting folders does:
Deleting ASP.NET 2.0 Application Sub-Directories Shuts Down the AppDomain[^]
Update::Deleting ASP.NET 2.0 Application Sub-Directories Shuts Down the AppDomain[^]

The only way to stop it is to store the folders outside of the application root.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900