session, cookie or cache?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dan

    #1

    session, cookie or cache?

    Hi,

    i need to keep in memory for all pages the windows-login of the user of the
    intranet.
    I use therefore Request.ServerV ariables("remot e_user").

    Now what is the best: putting it in a session variable or into a cookie or
    into a cache variable using data cache?

    More generally, if i have to keep a lot of data into memory, what's the best
    to use?

    Thanks fo advice
    Dan


  • webdeveloper

    #2
    Re: session, cookie or cache?

    I always use the server variable "logon_user ". But anyway: Why do you
    want to save it? You can always access it this way, you do not need to
    save it a second time.
    Eric

    Comment

    • Dan

      #3
      Re: session, cookie or cache?

      Ok, that right.
      I reformulate it: a certain value must be available for all pages: what's
      the best technique?

      "webdevelop er" <M8R-nb6119@mailinat or.comschreef in bericht
      news:a1c58a1e-f0c3-4258-95f4-8e9d028d05b4@e3 9g2000hsf.googl egroups.com...
      >I always use the server variable "logon_user ". But anyway: Why do you
      want to save it? You can always access it this way, you do not need to
      save it a second time.
      Eric

      Comment

      • Patrice

        #4
        Re: session, cookie or cache?

        As most often, there is not a single technique that should solve all
        problems.

        It depends on size (is this a string, a number or a whole dataset), scope
        (is this for a particular user or all users), lifetime (is this for the
        whole session or could it be just usefull for a limit amount of time)
        etc....

        I would recommend hiding these details behind a "State Management" class.
        This way you'll be able to change these details at will without much impact
        on your existing code especially if you are not sure about what is your best
        option for a particular case...

        What are those data ? Are they a whole chunk (a dataset ?) or lots of
        unrelated values ? Are they shared by all users ? etc...


        --
        Patrice

        "Dan" <nm@zszsz.xva écrit dans le message de groupe de discussion :
        ObdilPrAJHA.531 6@TK2MSFTNGP04. phx.gbl...
        Ok, that right.
        I reformulate it: a certain value must be available for all pages: what's
        the best technique?
        >
        "webdevelop er" <M8R-nb6119@mailinat or.comschreef in bericht
        news:a1c58a1e-f0c3-4258-95f4-8e9d028d05b4@e3 9g2000hsf.googl egroups.com...
        >>I always use the server variable "logon_user ". But anyway: Why do you
        >want to save it? You can always access it this way, you do not need to
        >save it a second time.
        >Eric
        >
        >

        Comment

        • Hans Kesting

          #5
          Re: session, cookie or cache?

          Dan used his keyboard to write :
          Ok, that right.
          I reformulate it: a certain value must be available for all pages: what's the
          best technique?
          >
          the usual answer: "it depends" :-)

          cookie: needs to be sent between client and server, so no good for
          large or sensitive data

          session: designed for per-user storage, but takes up server memory
          (unless you switch to state server or sqlserver storage)

          cache: good for application-wide storage, NOT for user-specific
          storage. It is possible that the system removes items that are not used
          frequently, so make sure you can handle that.

          Hans Kesting
          "webdevelop er" <M8R-nb6119@mailinat or.comschreef in bericht
          news:a1c58a1e-f0c3-4258-95f4-8e9d028d05b4@e3 9g2000hsf.googl egroups.com...
          >>I always use the server variable "logon_user ". But anyway: Why do you
          >want to save it? You can always access it this way, you do not need to
          >save it a second time.
          >Eric

          Comment

          Working...