[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.caching

all sessions lost after deleting folders

Filip

4/13/2006 9:02:00 AM

I have a big problem,

I'm developing a filemanager in Asp.NET 2.0 C#, as a filemanager do , I
delete,add,rename folders and files. After weeks of searching te problem why
the session is lost everytime I do an action like delete.. Finally I found
it . It causes the
appDomain to restart. The result of this is that all sessions are lost! Big
issue cause all information is kept in there when a user of the FileManager
logs in. I read several articles like Tod's one and Scott about appDomain
restarting when changing the folder or bin,webconfig in ASP.NET 2.0! In
ASP.NET 1.1 it works and the sessions doesn't dissapear. That sounds like a
step backwards to me.

Now is there a good solution or workaround to help this major problem?
there is the Linkd-command solution, but I guess it won't work on external
server.

If anyone have the same problem or even gets a solution you can contact me
@ filip_hunninck@hotmail.com

It would be very lucky if someone has solution for this

Tnx
8 Answers

Brock Allen

4/13/2006 12:53:00 PM

0

You can configure session to live outside of the worker process such that
it will survive AppDomain restarts. Check out the mode option for session
state.

-Brock
http://staff.develop....


> I have a big problem,
>
> I'm developing a filemanager in Asp.NET 2.0 C#, as a filemanager do ,
> I delete,add,rename folders and files. After weeks of searching te
> problem why the session is lost everytime I do an action like delete..
> Finally I found it . It causes the appDomain to restart. The result of
> this is that all sessions are lost! Big issue cause all information is
> kept in there when a user of the FileManager logs in. I read several
> articles like Tod's one and Scott about appDomain restarting when
> changing the folder or bin,webconfig in ASP.NET 2.0! In ASP.NET 1.1 it
> works and the sessions doesn't dissapear. That sounds like a step
> backwards to me.
>
> Now is there a good solution or workaround to help this major problem?
> there is the Linkd-command solution, but I guess it won't work on
> external server.
>
> If anyone have the same problem or even gets a solution you can
> contact me @ filip_hunninck@hotmail.com
>
> It would be very lucky if someone has solution for this
>
> Tnx
>


Filip

4/14/2006 7:32:00 AM

0

That is a good idea, I tried it but I get some errors like these:

Unable to use SQL Server because ASP.NET version 2.0 Session State is not
installed on the SQL server. Please install ASP.NET Session State SQL Server
version 2.0 or above.

this was for the sqlserver , but it's the same with StateServer. I'm using
it locally (for the moment). Suppose I can 'install' the version of sql
server version, local. What to do when I'm on a external hostserver?

"Brock Allen" wrote:

> You can configure session to live outside of the worker process such that
> it will survive AppDomain restarts. Check out the mode option for session
> state.
>
> -Brock
> http://staff.develop....
>
>
> > I have a big problem,
> >
> > I'm developing a filemanager in Asp.NET 2.0 C#, as a filemanager do ,
> > I delete,add,rename folders and files. After weeks of searching te
> > problem why the session is lost everytime I do an action like delete..
> > Finally I found it . It causes the appDomain to restart. The result of
> > this is that all sessions are lost! Big issue cause all information is
> > kept in there when a user of the FileManager logs in. I read several
> > articles like Tod's one and Scott about appDomain restarting when
> > changing the folder or bin,webconfig in ASP.NET 2.0! In ASP.NET 1.1 it
> > works and the sessions doesn't dissapear. That sounds like a step
> > backwards to me.
> >
> > Now is there a good solution or workaround to help this major problem?
> > there is the Linkd-command solution, but I guess it won't work on
> > external server.
> >
> > If anyone have the same problem or even gets a solution you can
> > contact me @ filip_hunninck@hotmail.com
> >
> > It would be very lucky if someone has solution for this
> >
> > Tnx
> >
>
>
>

Egil Hogholt

4/14/2006 9:02:00 AM

0

Hi.
You have to create the database on the SQL Server for storing the session
data. You can create it using the ASPNET_REGSQL.EXE tool in
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

The DB can be deployed using a script when you deploy to an external host
server.

Cheers,
Egil
http://www....

"Filip" <Filip@discussions.microsoft.com> wrote in message
news:51659838-4410-4C5C-8C54-9BFD3C5A4905@microsoft.com...
> That is a good idea, I tried it but I get some errors like these:
>
> Unable to use SQL Server because ASP.NET version 2.0 Session State is not
> installed on the SQL server. Please install ASP.NET Session State SQL
> Server
> version 2.0 or above.
>
> this was for the sqlserver , but it's the same with StateServer. I'm using
> it locally (for the moment). Suppose I can 'install' the version of sql
> server version, local. What to do when I'm on a external hostserver?
>
> "Brock Allen" wrote:
>
<!-- cut -->


Filip

4/21/2006 1:55:00 PM

0

Dear Egil,

I took a look at aspnet_regsql.exe tool and all the parameters. If you
want.. I'm gonna have need of your help. I want to try it with a SessionState
and run the script on the external database.

i tried: aspnet_regsql.exe -d [customdatabaseName] -ssadd -sstype c
-sqlexportonly c:\file.sql

So the script is exporting to the file c:\file.sql. And when i run that
script on the sql server in customdatabaseName it is gonna work, right?
So you have to preserve a whole database only for the sessionState? Cause I
only use an amount 15 Sessions in my project.

In Web.config you have to set

<sessionState mode="StateServer"
sqlConnectionString="Data
Source=SQLServerCustomDatabase;Initial Catalog=NAME;Persist Security
Info=True;User ID=U_ID;Password=PW"
cookieless="false"
timeout="15"/>

Is this correct? I really want to have a breakthrough my problems with
losing sessions after deleting folders in appDomain. Hoping this gonna work.

Tnx in advance!!!!
Kind Regards ,
Filip





"Egil Hogholt" wrote:

> Hi.
> You have to create the database on the SQL Server for storing the session
> data. You can create it using the ASPNET_REGSQL.EXE tool in
> C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
>
> The DB can be deployed using a script when you deploy to an external host
> server.
>
> Cheers,
> Egil
> http://www....
>
> "Filip" <Filip@discussions.microsoft.com> wrote in message
> news:51659838-4410-4C5C-8C54-9BFD3C5A4905@microsoft.com...
> > That is a good idea, I tried it but I get some errors like these:
> >
> > Unable to use SQL Server because ASP.NET version 2.0 Session State is not
> > installed on the SQL server. Please install ASP.NET Session State SQL
> > Server
> > version 2.0 or above.
> >
> > this was for the sqlserver , but it's the same with StateServer. I'm using
> > it locally (for the moment). Suppose I can 'install' the version of sql
> > server version, local. What to do when I'm on a external hostserver?
> >
> > "Brock Allen" wrote:
> >
> <!-- cut -->
>
>
>

Egil Hogholt

4/26/2006 6:58:00 PM

0

Hi Filip.
You have to use mode="SQLServer" to maintain session state in a SQL Server.

What you "have to"/"can do" depends on your web hosting provider as some may
provide a StateServer for you.

You can use a dedicated session state server with a syntax like this:
<sessionState
mode="StateServer"
....
stateConnectionString="tcpip=server:port"
stateNetworkTimeout="number of seconds"
</sessionState>
......


You have to use this syntax to use a SQL Server:
<sessionState
mode="SQLServer"
sqlConnectionString="Data Source=SQLServerCustomDatabase;Initial
Catalog=NAME;Persist Security Info=True;User ID=U_ID;Password=PW"
sqlCommandTimeout="10"
...
</sessionState>


Cheers,
Egil
http://www....

"Filip" <Filip@discussions.microsoft.com> wrote in message
news:A3FFC1D4-2998-4D94-96BF-952ADDAC58D4@microsoft.com...
> Dear Egil,
>
> I took a look at aspnet_regsql.exe tool and all the parameters. If you
> want.. I'm gonna have need of your help. I want to try it with a
> SessionState
> and run the script on the external database.
>
> i tried: aspnet_regsql.exe -d [customdatabaseName] -ssadd -sstype c
> -sqlexportonly c:\file.sql
>
> So the script is exporting to the file c:\file.sql. And when i run that
> script on the sql server in customdatabaseName it is gonna work, right?
> So you have to preserve a whole database only for the sessionState? Cause
> I
> only use an amount 15 Sessions in my project.
>
> In Web.config you have to set
>
> <sessionState mode="StateServer"
> sqlConnectionString="Data
> Source=SQLServerCustomDatabase;Initial Catalog=NAME;Persist Security
> Info=True;User ID=U_ID;Password=PW"
> cookieless="false"
> timeout="15"/>
>
> Is this correct? I really want to have a breakthrough my problems with
> losing sessions after deleting folders in appDomain. Hoping this gonna
> work.
>
> Tnx in advance!!!!
> Kind Regards ,
> Filip
<!-- cut -->


Filip

5/2/2006 1:13:00 PM

0

Hi,
I did all the things you said.
Tnx it works quit good.

I'v got another question, is it possible to do that on a Mysql Database??

TNX!!
Regards

"Egil Hogholt" wrote:

> Hi Filip.
> You have to use mode="SQLServer" to maintain session state in a SQL Server.
>
> What you "have to"/"can do" depends on your web hosting provider as some may
> provide a StateServer for you.
>
> You can use a dedicated session state server with a syntax like this:
> <sessionState
> mode="StateServer"
> ....
> stateConnectionString="tcpip=server:port"
> stateNetworkTimeout="number of seconds"
> </sessionState>
> ......
>
>
> You have to use this syntax to use a SQL Server:
> <sessionState
> mode="SQLServer"
> sqlConnectionString="Data Source=SQLServerCustomDatabase;Initial
> Catalog=NAME;Persist Security Info=True;User ID=U_ID;Password=PW"
> sqlCommandTimeout="10"
> ...
> </sessionState>
>
>
> Cheers,
> Egil
> http://www....
>
> "Filip" <Filip@discussions.microsoft.com> wrote in message
> news:A3FFC1D4-2998-4D94-96BF-952ADDAC58D4@microsoft.com...
> > Dear Egil,
> >
> > I took a look at aspnet_regsql.exe tool and all the parameters. If you
> > want.. I'm gonna have need of your help. I want to try it with a
> > SessionState
> > and run the script on the external database.
> >
> > i tried: aspnet_regsql.exe -d [customdatabaseName] -ssadd -sstype c
> > -sqlexportonly c:\file.sql
> >
> > So the script is exporting to the file c:\file.sql. And when i run that
> > script on the sql server in customdatabaseName it is gonna work, right?
> > So you have to preserve a whole database only for the sessionState? Cause
> > I
> > only use an amount 15 Sessions in my project.
> >
> > In Web.config you have to set
> >
> > <sessionState mode="StateServer"
> > sqlConnectionString="Data
> > Source=SQLServerCustomDatabase;Initial Catalog=NAME;Persist Security
> > Info=True;User ID=U_ID;Password=PW"
> > cookieless="false"
> > timeout="15"/>
> >
> > Is this correct? I really want to have a breakthrough my problems with
> > losing sessions after deleting folders in appDomain. Hoping this gonna
> > work.
> >
> > Tnx in advance!!!!
> > Kind Regards ,
> > Filip
> <!-- cut -->
>
>
>

Egil Hogholt

5/3/2006 12:32:00 PM

0

Yes, it is possible with ASP.NET 2.0

With ASP.NET 1.* you have to use MS SQLServer but ASP.NET 2.0 lets you write
your own custom mechanism to store sessions. This MSDN article has more
info:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/ASPNETProvMo...

I had a quick look with Google and found this MySQL .NET Data Provider that
seems to include a Session State provider: http://www.crlab.com...

Cheers,
Egil
http://www....

"Filip" <Filip@discussions.microsoft.com> wrote in message
news:0ADECB10-C207-4CBD-ABFA-C2C73A4E2F6E@microsoft.com...
> Hi,
> I did all the things you said.
> Tnx it works quit good.
>
> I'v got another question, is it possible to do that on a Mysql Database??
>
> TNX!!
> Regards
<!-- cut -->


Benjamin Strackany

6/6/2006 6:28:00 PM

0

Couldn't you just use mode=StateServer & skip the whole database aspect?

Ben Strackany
www.developmentnow.com


"Filip" <Filip@discussions.microsoft.com> wrote in message
news:0ADECB10-C207-4CBD-ABFA-C2C73A4E2F6E@microsoft.com...
> Hi,
> I did all the things you said.
> Tnx it works quit good.
>
> I'v got another question, is it possible to do that on a Mysql Database??
>
> TNX!!
> Regards
>
> "Egil Hogholt" wrote:
>
>> Hi Filip.
>> You have to use mode="SQLServer" to maintain session state in a SQL
>> Server.
>>
>> What you "have to"/"can do" depends on your web hosting provider as some
>> may
>> provide a StateServer for you.
>>
>> You can use a dedicated session state server with a syntax like this:
>> <sessionState
>> mode="StateServer"
>> ....
>> stateConnectionString="tcpip=server:port"
>> stateNetworkTimeout="number of seconds"
>> </sessionState>
>> ......
>>
>>
>> You have to use this syntax to use a SQL Server:
>> <sessionState
>> mode="SQLServer"
>> sqlConnectionString="Data Source=SQLServerCustomDatabase;Initial
>> Catalog=NAME;Persist Security Info=True;User ID=U_ID;Password=PW"
>> sqlCommandTimeout="10"
>> ...
>> </sessionState>
>>
>>
>> Cheers,
>> Egil
>> http://www....
>>
>> "Filip" <Filip@discussions.microsoft.com> wrote in message
>> news:A3FFC1D4-2998-4D94-96BF-952ADDAC58D4@microsoft.com...
>> > Dear Egil,
>> >
>> > I took a look at aspnet_regsql.exe tool and all the parameters. If you
>> > want.. I'm gonna have need of your help. I want to try it with a
>> > SessionState
>> > and run the script on the external database.
>> >
>> > i tried: aspnet_regsql.exe -d [customdatabaseName] -ssadd -sstype c
>> > -sqlexportonly c:\file.sql
>> >
>> > So the script is exporting to the file c:\file.sql. And when i run
>> > that
>> > script on the sql server in customdatabaseName it is gonna work, right?
>> > So you have to preserve a whole database only for the sessionState?
>> > Cause
>> > I
>> > only use an amount 15 Sessions in my project.
>> >
>> > In Web.config you have to set
>> >
>> > <sessionState mode="StateServer"
>> > sqlConnectionString="Data
>> > Source=SQLServerCustomDatabase;Initial Catalog=NAME;Persist Security
>> > Info=True;User ID=U_ID;Password=PW"
>> > cookieless="false"
>> > timeout="15"/>
>> >
>> > Is this correct? I really want to have a breakthrough my problems with
>> > losing sessions after deleting folders in appDomain. Hoping this gonna
>> > work.
>> >
>> > Tnx in advance!!!!
>> > Kind Regards ,
>> > Filip
>> <!-- cut -->
>>
>>
>>