Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 17, 2012 09:36 AM by sameer_khanjit
0 Points
1 Post
Nov 11, 2012 11:49 PM|LINK
Hi everybody,
I'm sharing session variables in two different asp.net web applications.
I'm using "StateServer" mode.
For sharing, i set _appDomainAppId of the HttpRuntime same for applications with using reflection. In Application_Start function, here is my code:
string applicationName = "mysite" FieldInfo runtimeInfo = typeof(HttpRuntime).GetField("_theRuntime",BindingFlags.Static | BindingFlags.NonPublic); HttpRuntime theRuntime = (HttpRuntime)runtimeInfo.GetValue(null); FieldInfo appNameInfo = typeof(HttpRuntime).GetField("_appDomainAppId",BindingFlags.Instance | BindingFlags.NonPublic); appNameInfo.SetValue(theRuntime, applicationName);
Here is my question : I don't want to use reflection for this. I want to handle this in web.config.
Is there any way to set _appDomainAppId in web.config ? I couldn't find anything under the httpRuntime section or anywhere else.
Thank you.
All-Star
86773 Points
9643 Posts
Moderator
MVP
Nov 12, 2012 09:34 AM|LINK
There is no built-in way to do it from the web.config. Doing it using reflection is the only way to change it after the application starts.
Member
551 Points
145 Posts
Nov 15, 2012 10:58 AM|LINK
Not possible by web.config.
112 Points
26 Posts
Dec 13, 2012 10:59 AM|LINK
Hi,
Mybe you can try to configure you web.config to use "sqlserver" mode session state.
<sessionState mode="SQLServer" sqlConnectionString="data source=127.0.0.1;user id=<username>;password=<strongpassword>" cookieless="false" timeout="20" />
More information please follow: http://support.microsoft.com/kb/317604?wa=wsignin1.0
Contributor
7060 Points
1378 Posts
Dec 17, 2012 09:36 AM|LINK
you can use SQL server to store session state ,
Please see :-
http://support.microsoft.com/kb/317604
sAttc
0 Points
1 Post
Sharing session state using web.config not reflection
Nov 11, 2012 11:49 PM|LINK
Hi everybody,
I'm sharing session variables in two different asp.net web applications.
I'm using "StateServer" mode.
For sharing, i set _appDomainAppId of the HttpRuntime same for applications with using reflection. In Application_Start function, here is my code:
string applicationName = "mysite" FieldInfo runtimeInfo = typeof(HttpRuntime).GetField("_theRuntime",BindingFlags.Static | BindingFlags.NonPublic); HttpRuntime theRuntime = (HttpRuntime)runtimeInfo.GetValue(null); FieldInfo appNameInfo = typeof(HttpRuntime).GetField("_appDomainAppId",BindingFlags.Instance | BindingFlags.NonPublic); appNameInfo.SetValue(theRuntime, applicationName);Here is my question : I don't want to use reflection for this. I want to handle this in web.config.
Is there any way to set _appDomainAppId in web.config ? I couldn't find anything under the httpRuntime section or anywhere else.
Thank you.
DarrellNorto...
All-Star
86773 Points
9643 Posts
Moderator
MVP
Re: Sharing session state using web.config not reflection
Nov 12, 2012 09:34 AM|LINK
There is no built-in way to do it from the web.config. Doing it using reflection is the only way to change it after the application starts.
Darrell Norton's Blog
Please click "Mark as Answer" if this helped you.
Shailendra S...
Member
551 Points
145 Posts
Re: Sharing session state using web.config not reflection
Nov 15, 2012 10:58 AM|LINK
Not possible by web.config.
www.techaray.com
CommDev
Member
112 Points
26 Posts
Re: Sharing session state using web.config not reflection
Dec 13, 2012 10:59 AM|LINK
Hi,
Mybe you can try to configure you web.config to use "sqlserver" mode session state.
<sessionState mode="SQLServer" sqlConnectionString="data source=127.0.0.1;user id=<username>;password=<strongpassword>" cookieless="false" timeout="20" />More information please follow: http://support.microsoft.com/kb/317604?wa=wsignin1.0
sameer_khanj...
Contributor
7060 Points
1378 Posts
Re: Sharing session state using web.config not reflection
Dec 17, 2012 09:36 AM|LINK
you can use SQL server to store session state ,
Please see :-
http://support.microsoft.com/kb/317604
sameer.khanjit@gmail.com
View Blog
Click "Mark as Answer" on the post that helped you.