How to override HttpSessionStateContainer.CookieMode (ASP.NET 2.0)?

  • Thread starter Thread starter Steve Franks
  • Start date Start date
S

Steve Franks

Can someone please advise on how I can add logic that dynamically sets the
session state's cookie mode to UseUri or UseCookies on a per user basis?

In other words, depending on our business rules and logic, there are times
when I need to set a particular visitor's session to use the URL encoding
(CookieMode.UseUri) instead of using cookies. Yes I know there is an auto
type setting but that is not applicable to our needs. There are also
settings in web.config but again these settings apply to ALL sessions, and
instead I want the ability to use difference cookie modes for different
users.

From the ASP.NET 2.0 beta docs it looks like this can be done by creating a
class which implements the IHttpSessionState, as the CookieMode property of
the IHttpSessionStateContainer can be easily set from there. However to use
my own IHttpSessionStateContainer the docs say I have to replace the default
SessionStateModule with my own. That would be overkill because the default
SessionStateModule and HttpSessionStateContainers are perfect as-is... I
just need to tap in to the CookieMode property to control how it is set.
And the SessionStateModule is sealed, so if I understand correctly I simply
cannot create a new class and derrive from the default SessionStateModule -
so I would then have to code one from scratch? And as would be expected I
simply cannot set the CookieMode property in the Session object
after-the-fact, as that is a read-only property at that point.

Can somone please advise me on the most straight-forward way to tap into
this default session state management in ASP.NET 2.0 so I can dynamically
set the CookieMode individually for each user as needed (between
CookieMode.UseUri vs .UseCookies), based on my own rules?

Thanks!

Steve
 
Hi all - I posted this last week but unfortunately did not receive any
responses. I also tried posting this in a few other .NET forums and on and
advanced .NET discussion list, none of which received any replies either.

Can someone please tell me what a good way would be to try and pose this
question directly to the ASP.NET Beta 2.0 team? Do any of those folks lurk
here? I thought the ASP.NET forums would reach them but no answers there
either. I'm hoping someone on the MS dev team can help?

Thanks much!

Steve

With this in mind, can someone please tell me
 
Hi all - I posted this last week but unfortunately did not receive any
responses. I also tried posting this in a few other .NET forums and on and
advanced .NET discussion list, none of which received any replies either.

Can someone please tell me what a good way would be to try and pose this
question directly to the ASP.NET Beta 2.0 team? Do any of those folks lurk
here? I thought the ASP.NET forums would reach them but no answers there
either. I'm hoping someone on the MS dev team can help?

Thanks much!

Steve
 
Back
Top