Sharing a variable across virtual roots

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • boho
    New Member
    • Feb 2008
    • 5

    Sharing a variable across virtual roots

    Hi

    I have a website which is accessed externally via one virtual root ( requires SSL) and internally via an other virtual root. Is there a simple way to share variable, ie something like Application("va riable") across the roots?
    I have tried defining the variable in global.asax but run into access issues.

    /bo
  • boho
    New Member
    • Feb 2008
    • 5

    #2
    Anybody have any hints?

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      (I don't know for sure, subscribing because I would like to know how as well)
      Isn't there like an app.config file that works like the web.config? I don't think you can change those on the fly in the program, but it would allow for some common things to be shared?

      Can you get away with using the Session object?

      Comment

      • boho
        New Member
        • Feb 2008
        • 5

        #4
        Hi

        I doubt that the session object will be of any help since I need to share the variable across all sessions on both applications.

        /bo

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          Wait wait wait.
          You need an "in memory" value that will be used (either read or updated) from any session?

          Just use a static class, it's one class for all users, regardless of session

          Comment

          • boho
            New Member
            • Feb 2008
            • 5

            #6
            The value needs to be updated.
            The value is actually an indicator to show if there are any messages to fetch. If the flag indicates false no search is performed, and if the flag is true a search is done. Another agent is sending the messages an updates the flag when a message is sent. The 2 agents exist in different applications since one accesses the website via HTTP and the other one via HTTP. I found no way to combine HTTP and HTTPS under one virtual root so I created 2 virtual roots, where one only accepts the trusted party via HTTP, and all others must use the HTTPS root.

            Comment

            • Plater
              Recognized Expert Expert
              • Apr 2007
              • 7872

              #7
              Static classes can contain variables for updating.

              Comment

              • boho
                New Member
                • Feb 2008
                • 5

                #8
                Ok. Where should I create such a class so it is reachable from different applications? Could I create a "machine" class somehow?

                Comment

                • kenobewan
                  Recognized Expert Specialist
                  • Dec 2006
                  • 4871

                  #9
                  I may be barking up the wrong tree (have you ever seen a dog in a tree?), but I see three possible methods.

                  1) A boolean value should pose no threat if passed by a querystring, at least my bank sees no harm no foul
                  2) Class libraries are used in web farm/gardens and may or may not be useful here
                  3) If 1 & 2 aren't desirable, I assume this also may be achieved with a webservice

                  Comment

                  • Plater
                    Recognized Expert Expert
                    • Apr 2007
                    • 7872

                    #10
                    Originally posted by boho
                    Ok. Where should I create such a class so it is reachable from different applications? Could I create a "machine" class somehow?
                    Either I read your original question wrong or you edited it after I read it, but ok I see now what you were getting at.
                    A webservice might be the best route, although I am pretty sure there is like a machine.config type thing that you can specify in your config sections to allow some data to be shared between web applications.
                    Maybe Frinny knows?

                    Comment

                    Working...