By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,780 Members | 1,549 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,780 IT Pros & Developers. It's quick & easy.

Changing Session State programatically

P: n/a
Hi everybody,

Has anyone changed the session state in web.config programatically
through the applications. Any Help will be appreciated.

Thanks.

Nov 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
You can load up web.config into an XML dom, manipulate it, and save it back.
This will however restart the application, and all current sessions will be
dropped.

"Maximus" <me@maximus.net> wrote in message
news:eK**************@TK2MSFTNGP10.phx.gbl...
Hi everybody,

Has anyone changed the session state in web.config programatically
through the applications. Any Help will be appreciated.

Thanks.

Nov 18 '05 #2

P: n/a
If you make any changes to the web.config file and save it while the app is
running, the app will restart, losing any Application and/or Session data
that currently exists.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Maximus" <me@maximus.net> wrote in message
news:eK**************@TK2MSFTNGP10.phx.gbl...
Hi everybody,

Has anyone changed the session state in web.config programatically
through the applications. Any Help will be appreciated.

Thanks.

Nov 18 '05 #3

P: n/a
Kevin Spencer wrote:
If you make any changes to the web.config file and save it while the app is
running, the app will restart, losing any Application and/or Session data
that currently exists.

Hi Kevin,

Thanks a lot for the the help. I am aware of it and will still like t do
it as my application would not have a problem with it. So if you could
help me I'll appreciate it.

Thanks.

Nov 18 '05 #4

P: n/a
Marina wrote:
You can load up web.config into an XML dom, manipulate it, and save it back.
This will however restart the application, and all current sessions will be
dropped.

"Maximus" <me@maximus.net> wrote in message
news:eK**************@TK2MSFTNGP10.phx.gbl...
Hi everybody,

Has anyone changed the session state in web.config programatically
through the applications. Any Help will be appreciated.

Thanks.


Hi Marina,

I am aware of the application restarting. I do not ahve a problem with
it. What I thought was there was a .net class like ConfigurationSetting
which I can use to load the session state like
Configuration.GetConfig("system.web/sessionState") and then manipulate
it and save it. I was not sure how to do that. Was wondering if you
could helo me.

Thanks.

Nov 18 '05 #5

P: n/a
Well, it's a text file. Just open, parse, and change it, then save it back.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Maximus" <me@maximus.net> wrote in message
news:#8**************@tk2msftngp13.phx.gbl...
Kevin Spencer wrote:
If you make any changes to the web.config file and save it while the app is running, the app will restart, losing any Application and/or Session data that currently exists.

Hi Kevin,

Thanks a lot for the the help. I am aware of it and will still like t do
it as my application would not have a problem with it. So if you could
help me I'll appreciate it.

Thanks.

Nov 18 '05 #6

P: n/a
Yes, I did tell you how to do it. Load it up into an xml dom, change it, and
save it back.

The configuration classes are meant for read only access. You are not really
supposed to change it from the application itself, so no such methods were
provided.

"Maximus" <me@maximus.net> wrote in message
news:Oc**************@tk2msftngp13.phx.gbl...
Marina wrote:
You can load up web.config into an XML dom, manipulate it, and save it back. This will however restart the application, and all current sessions will be dropped.

"Maximus" <me@maximus.net> wrote in message
news:eK**************@TK2MSFTNGP10.phx.gbl...
Hi everybody,

Has anyone changed the session state in web.config programatically
through the applications. Any Help will be appreciated.

Thanks.


Hi Marina,

I am aware of the application restarting. I do not ahve a problem with
it. What I thought was there was a .net class like ConfigurationSetting
which I can use to load the session state like
Configuration.GetConfig("system.web/sessionState") and then manipulate
it and save it. I was not sure how to do that. Was wondering if you
could helo me.

Thanks.

Nov 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.