I'm deleting a directory from within an ASP.NET application. The deletion goes fine, but when I return from it all my session data from before the delete is lost.
It doesn't matter whether I use:
if (Directory.Exists(folderPath))
Directory.Delete(folderPath, true);
Or:
System.IO.DirectoryInfo d = new System.IO.DirectoryInfo(folderPath);
if (d.Exists)
d.Delete(true);
In both cases I lose my session data.
Has anyone run into this problem?