Possible to turn on/off cookieless sessions dynamically on a case by case basis at run-time?

Discussion in 'ASP .Net' started by Steve Franks, Jun 2, 2004.

  1. Steve Franks

    Steve Franks Guest

    According to the docs you tell ASP.NET to use cookieless sessions by setting
    a value in the config.web file.

    However, what if I wanted to determine at run time whether or not I wanted
    to use cookieless sessions for a particular user, and if so, I'd instruct
    ASP.NET to turn on cookieless sessions for a particular user session. Is
    this possible?

    For example I want to use cookie based sessions by default for all users.
    But if a user has set a preference in my sites options to not use cookies on
    my site, I want to dynamically at run time force ASP.NET to use cookieless
    sessions for this one visitor in particular, while everyone else runs with
    cookie based sessions by default.

    Is there a property I can set/override at run time within the HttpContext or
    something else (perhaps I can intercept the request via a HttpModule and set
    a property to turn cookieless sessions on/off?) to tell ASP.NET to force
    sessionless cookies on a case by case basis? Or is the only way to do this
    through the config file, in which case it is either cookieless sessions for
    everyone or cookieless sessions for no one (based on the boolean set in
    config.web)?

    If there is no way to override this setting dynamically at run time (so I
    can use cookieless sessions for some visitors and not others) is there any
    other fancy way I can effectively force ASP.NET to do this? Such as getting
    fancy within an HttpModule to perform what ASP.NET would be doing, etc?

    Any ideas would be really appreciated. Thanks to all in advance for your
    thoughts on this.

    Steve
     
    Steve Franks, Jun 2, 2004
    #1
    1. Advertising

  2. Steve Franks

    Steve Franks Guest

    Does anyone have an some idea on whether this can be done, and if so, how?
    Microsoft gurus - what do you think?


    "Steve Franks" <> wrote in message
    news:...
    > According to the docs you tell ASP.NET to use cookieless sessions by

    setting
    > a value in the config.web file.
    >
    > However, what if I wanted to determine at run time whether or not I wanted
    > to use cookieless sessions for a particular user, and if so, I'd instruct
    > ASP.NET to turn on cookieless sessions for a particular user session. Is
    > this possible?
    >
    > For example I want to use cookie based sessions by default for all users.
    > But if a user has set a preference in my sites options to not use cookies

    on
    > my site, I want to dynamically at run time force ASP.NET to use cookieless
    > sessions for this one visitor in particular, while everyone else runs with
    > cookie based sessions by default.
    >
    > Is there a property I can set/override at run time within the HttpContext

    or
    > something else (perhaps I can intercept the request via a HttpModule and

    set
    > a property to turn cookieless sessions on/off?) to tell ASP.NET to force
    > sessionless cookies on a case by case basis? Or is the only way to do

    this
    > through the config file, in which case it is either cookieless sessions

    for
    > everyone or cookieless sessions for no one (based on the boolean set in
    > config.web)?
    >
    > If there is no way to override this setting dynamically at run time (so I
    > can use cookieless sessions for some visitors and not others) is there any
    > other fancy way I can effectively force ASP.NET to do this? Such as

    getting
    > fancy within an HttpModule to perform what ASP.NET would be doing, etc?
    >
    > Any ideas would be really appreciated. Thanks to all in advance for your
    > thoughts on this.
    >
    > Steve
    >
    >
     
    Steve Franks, Jun 4, 2004
    #2
    1. Advertising

  3. Steve Franks

    Steve Franks Guest

    Does anyone know if Microsoft engineers monitor / reply to the group? Since
    it has been about a week with no responses I am assuming this is either a
    complex topic or something that there is little or no information on. So
    I'm hoping that maybe someone at Microsoft can shed some light or perhaps
    point me in the right direction (or even tell me that this is not possible).
    Anyone?

    "Steve Franks" <> wrote in message
    news:...
    > According to the docs you tell ASP.NET to use cookieless sessions by

    setting
    > a value in the config.web file.
    >
    > However, what if I wanted to determine at run time whether or not I wanted
    > to use cookieless sessions for a particular user, and if so, I'd instruct
    > ASP.NET to turn on cookieless sessions for a particular user session. Is
    > this possible?
    >
    > For example I want to use cookie based sessions by default for all users.
    > But if a user has set a preference in my sites options to not use cookies

    on
    > my site, I want to dynamically at run time force ASP.NET to use cookieless
    > sessions for this one visitor in particular, while everyone else runs with
    > cookie based sessions by default.
    >
    > Is there a property I can set/override at run time within the HttpContext

    or
    > something else (perhaps I can intercept the request via a HttpModule and

    set
    > a property to turn cookieless sessions on/off?) to tell ASP.NET to force
    > sessionless cookies on a case by case basis? Or is the only way to do

    this
    > through the config file, in which case it is either cookieless sessions

    for
    > everyone or cookieless sessions for no one (based on the boolean set in
    > config.web)?
    >
    > If there is no way to override this setting dynamically at run time (so I
    > can use cookieless sessions for some visitors and not others) is there any
    > other fancy way I can effectively force ASP.NET to do this? Such as

    getting
    > fancy within an HttpModule to perform what ASP.NET would be doing, etc?
    >
    > Any ideas would be really appreciated. Thanks to all in advance for your
    > thoughts on this.
    >
    > Steve
    >
    >
     
    Steve Franks, Jun 10, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    3,274
    Ravi Singh (UCSD)
    May 10, 2006
  2. Replies:
    0
    Views:
    386
  3. robert112
    Replies:
    1
    Views:
    445
    Juan T. Llibre
    Apr 26, 2007
  4. Replies:
    14
    Views:
    538
    bijeshn
    Apr 8, 2008
  5. scottymo
    Replies:
    3
    Views:
    708
    Dominick Baier
    Sep 30, 2006
Loading...

Share This Page