views:

121

answers:

2

I am developing a website to extend community server, and i found that community server disabled the session in the web.config <sessionState mode="Off" />.
Now i have a webpage that i created and must use session inside it, but i don't want to edit the web.config sessionState value,
Can i enable session state on just the page level? or there is another idea to do that?

+1  A: 

I don't know that you can enable session state just for a single page - possible, but unlikely.

Instead, you could look to use either the ASP.NET Cache, which is similar but does not isolate data between sessions (you'd have to do that yourself). Or, you could look to create a static data structure somewhere in your application that manages per-session state. Lastly, you may be able to just make your objects serializable and store them in ViewState (if they aren't to large). ViewState can be configured at the individual page (or even Control) level.

You should try to be consistent with the approach your organization has chosen regarding state management. There may be a reason that server-side state is being avoided (perhaps for something like load balancing). Without understanding the reasoning behind this decision, you may introduce unexpected problems.

LBushkin
A: 

Amr,

Any futher information on this?

I want to turn on session state in my community server application. What the impact would be?

thanks.

nivas
regarding this issue in community server, once before i enabled the session in the web.config, and things was running normally, but later i disabled it as my manager told me to disable it because he thought it may cause security issues, but i didn't find any security holes my self.
Amr ElGarhy