Session expires after Directory.Move

  • Thread starter Thread starter Adhik Kadam
  • Start date Start date
A

Adhik Kadam

Hi,

I am facing bit different problem. I am using move method of Directory Class
to rename folder to new name.
But it is doing some nasty thing i.e. why and how it is removing current
session (current session expires) after execution of Move Command.

This is small but huge problem to me as my whole application works on
session, and user needs to login again once this code is executed..

What could be the problem and how can get rid of this.

Thanks in advance
Adhik
 
Adhik,

Are you moving content that the current ASP.NET application depends on?
If that is the case, then it will have to recompile the app, and will shut
down the app domain that is currently running in order to do this. You
shouldn't modify files or directories that are part of your ASP.NET
application while it is running if you want to prevent this.

Hope this helps.
 
Thankx Nicholas,

Basically my application is Knowledgebase type, where eveything this
works on Folder Path for storing and sharing documents.
I have root of this knowledegebase document folders inside my root
directory of application(site).
------------------------------------------------------------------------
--------------------------------------------
//**** Application AND KB Document Directory Structure
****************//
/Application(Site) *** This application root folder
/Code
/Workbench
EditDeaprtment.aspx
EditLogin.aspx

/Knowledgebase *** This knowledgebase doucments root folder
/Marketing
/Jon
/Michale
/Sales
/Vicky
------------------------------------------------------------------------
-----------------------------------------------
And Inside this KB Root folder I m creating separate folder for Each
Department and Inside Department seprate folder for Each Employee of
dept.
So When ever dept name or employee login name is changed I want to
rename resp. folder.

Do u have any idea abt how should I handle this problem?

Thanks in advance
Adhik
 
Hi Nicholas,

I have tried one soltuion.
I write two functions
1.GetSession - This will take session values in local variable.
2.SetSession - This will set values to session variables.

Before executing Directory.Move I give call to GetSession, and after
Directory.Move I give call to SetSession.

Here If I print values of session variables after Move Command I am
getting session values.
But When control is redirect to another page(Thankyou.aspx) after
Direcoty.Move and SetSession I am not getting session values on Next
page.

Anticipating your response.

With warm regards
Adhik
 
HI,

I changed my session setting in web.config. Insted of InProc, using SQL
Server for session.

This works fine...and now session is not expiring after renaming (Moving )
Folder.

Cheers
Adhik
 
Back
Top