Click to See Complete Forum and Search --> : Directory.Move() is destroying my session information


NickTheNewbie
January 18th, 2007, 02:06 PM
I'm using vb.net in ASP.NET with the 2.0 framework.


I'm attempting to rename a directory inside my web app's directory using the Directory.Move() function. Whenever I use this function, though, my session state is destroyed. Does anyone know what could be causing this?

mcmcom
January 18th, 2007, 03:58 PM
can you post some of the code your trying? Directory.Move on its own shouldn't kill anything in the session object.

mcm

mcmcom
January 18th, 2007, 04:07 PM
more info on this :

http://www.velocityreviews.com/forums/t96204-directorymove-gt-losing-session.html

basically if your moving the pages that the app is located in (or a dir the app is in) it WILL lose state because of the fact the pages have been "touched" so the app has to re-start.

The option detailed in the link above is less than ideal. I suggest you look at Session Persistance using SQL Server and store the session to a db before your directory.move is called. Then re-load it based on something like a hidden field or a key in the querystring

hth,
mcm

NickTheNewbie
January 19th, 2007, 08:43 AM
Alright thanks for the info!