Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. Sessions in WCF

Sessions in WCF

Scheduled Pinned Locked Moved WCF and WF
questioncsharpwcfhelp
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cdpace
    wrote on last edited by
    #1

    Hello guys, My question is can you somehow in WCF hold a session for every user that connects to WCF. And can that session be accesed from all the services in that WCF, and share the information in that session between each other? can this be done? your help is greatly appreciated. Thank you from adavance Regards, Christian Pace

    S 1 Reply Last reply
    0
    • C cdpace

      Hello guys, My question is can you somehow in WCF hold a session for every user that connects to WCF. And can that session be accesed from all the services in that WCF, and share the information in that session between each other? can this be done? your help is greatly appreciated. Thank you from adavance Regards, Christian Pace

      S Offline
      S Offline
      Sir Dot Net
      wrote on last edited by
      #2

      Unlike ASP.net, there is no 'Session' storage model. You would most likely have to write your own class that stores the variables (maybe a dictionary type) and make that class available statically. The static class then could be accessed by all client session instances (assuming you are using session instancing). The main thing is that these sessions aren't really way too reliable. They don't act like ASP.net sessions, and if a connection is closed and re-opened by the client the session id will be different on the service instance, thus, your 'session' variables should be short-term, made to persist for information that is shared between a series of calls, but not accessed randomly throughout the client's lifetime.

      C 1 Reply Last reply
      0
      • S Sir Dot Net

        Unlike ASP.net, there is no 'Session' storage model. You would most likely have to write your own class that stores the variables (maybe a dictionary type) and make that class available statically. The static class then could be accessed by all client session instances (assuming you are using session instancing). The main thing is that these sessions aren't really way too reliable. They don't act like ASP.net sessions, and if a connection is closed and re-opened by the client the session id will be different on the service instance, thus, your 'session' variables should be short-term, made to persist for information that is shared between a series of calls, but not accessed randomly throughout the client's lifetime.

        C Offline
        C Offline
        cdpace
        wrote on last edited by
        #3

        Thank you in fact that is my current implementation and know what I did is that I am identifing the users by means of

        C 1 Reply Last reply
        0
        • C cdpace

          Thank you in fact that is my current implementation and know what I did is that I am identifing the users by means of

          C Offline
          C Offline
          cdpace
          wrote on last edited by
          #4

          of ServiceSecurityContext.WindowsIdentity.User

          C 1 Reply Last reply
          0
          • C cdpace

            of ServiceSecurityContext.WindowsIdentity.User

            C Offline
            C Offline
            cdpace
            wrote on last edited by
            #5

            Sorry about the half postes ;) and thank you very much for your help.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups