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. Web Development
  3. ASP.NET
  4. Difference b/n session and cache

Difference b/n session and cache

Scheduled Pinned Locked Moved ASP.NET
question
8 Posts 4 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.
  • N Offline
    N Offline
    NidhiKanu
    wrote on last edited by
    #1

    Hi, what is difference between adding a value to session variable or cache N!dh! :)

    A A 2 Replies Last reply
    0
    • N NidhiKanu

      Hi, what is difference between adding a value to session variable or cache N!dh! :)

      A Offline
      A Offline
      anujbanka1784
      wrote on last edited by
      #2

      A cookie is a small amount of data that is stored either in a text file on the client file system or in-memory in the client browser session. It contains site-specific information that the server sends to the client along with page output. Cookies can be temporary (with specific expiration times and dates) or persistent. You can use cookies to store information about a particular client, session, or application. The cookies are saved on the client device, and when the browser requests a page, the client sends the information in the cookie along with the request information. The server can read the cookie and extract its value. A typical use is to store a token (perhaps encrypted) indicating that the user has already been authenticated in your application. ASP.NET allows you to save values by using session state — which is an instance of the HttpSessionState class — for each active Web-application session. For an overview, see ASP.NET Session State Overview. Session state is similar to application state, except that it is scoped to the current browser session. If different users are using your application, each user session will have a different session state. In addition, if a user leaves your application and then returns later, the second user session will have a different session state from the first. Session state is structured as a key/value dictionary for storing session-specific information that needs to be maintained between server round trips and between requests for pages. For more information, see ASP.NET Session State Overview. You can use session state to accomplish the following tasks: • Uniquely identify browser or client-device requests and map them to an individual session instance on the server. • Store session-specific data on the server for use across multiple browser or client-device requests within the same session. • Raise appropriate session management events. In addition, you can write application code leveraging these events. Once you add your application-specific information to session state, the server manages this object. Depending on which options you specify, session information can be stored in cookies, on an out-of-process server, or on a computer running Microsoft SQL Server. For usage recommendations, see ASP.NET State Management Recommendations. The following example shows how to save a value in session state. Visual Basic Copy Code Session("FirstName") = FirstNameTextBox.Text Session("LastName") = LastNameTextBox.Text C#

      N 1 Reply Last reply
      0
      • N NidhiKanu

        Hi, what is difference between adding a value to session variable or cache N!dh! :)

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        Session Vs Cache[^]

        cheers, Abhijit CodeProject MVP My Recent Article : Exploring Session in ASP.Net

        N 1 Reply Last reply
        0
        • A anujbanka1784

          A cookie is a small amount of data that is stored either in a text file on the client file system or in-memory in the client browser session. It contains site-specific information that the server sends to the client along with page output. Cookies can be temporary (with specific expiration times and dates) or persistent. You can use cookies to store information about a particular client, session, or application. The cookies are saved on the client device, and when the browser requests a page, the client sends the information in the cookie along with the request information. The server can read the cookie and extract its value. A typical use is to store a token (perhaps encrypted) indicating that the user has already been authenticated in your application. ASP.NET allows you to save values by using session state — which is an instance of the HttpSessionState class — for each active Web-application session. For an overview, see ASP.NET Session State Overview. Session state is similar to application state, except that it is scoped to the current browser session. If different users are using your application, each user session will have a different session state. In addition, if a user leaves your application and then returns later, the second user session will have a different session state from the first. Session state is structured as a key/value dictionary for storing session-specific information that needs to be maintained between server round trips and between requests for pages. For more information, see ASP.NET Session State Overview. You can use session state to accomplish the following tasks: • Uniquely identify browser or client-device requests and map them to an individual session instance on the server. • Store session-specific data on the server for use across multiple browser or client-device requests within the same session. • Raise appropriate session management events. In addition, you can write application code leveraging these events. Once you add your application-specific information to session state, the server manages this object. Depending on which options you specify, session information can be stored in cookies, on an out-of-process server, or on a computer running Microsoft SQL Server. For usage recommendations, see ASP.NET State Management Recommendations. The following example shows how to save a value in session state. Visual Basic Copy Code Session("FirstName") = FirstNameTextBox.Text Session("LastName") = LastNameTextBox.Text C#

          N Offline
          N Offline
          NidhiKanu
          wrote on last edited by
          #4

          Hi, Its all information about session where i want to know about difference b/n session variable and cache variable. N!dh! :)

          1 Reply Last reply
          0
          • A Abhijit Jana

            Session Vs Cache[^]

            cheers, Abhijit CodeProject MVP My Recent Article : Exploring Session in ASP.Net

            N Offline
            N Offline
            NidhiKanu
            wrote on last edited by
            #5

            Thnx,wen i go through Google ten i got this difference,but one confusion is there that caching is not user specific,so if same person log in from different computers ten wat happen.it will clash both or will some infliction occur N!dh! :)

            A 1 Reply Last reply
            0
            • N NidhiKanu

              Thnx,wen i go through Google ten i got this difference,but one confusion is there that caching is not user specific,so if same person log in from different computers ten wat happen.it will clash both or will some infliction occur N!dh! :)

              A Offline
              A Offline
              Abhijit Jana
              wrote on last edited by
              #6

              Let me clear the thing first, Caching and Session both are server side state management. Session is User Specific , Session data is stored in either Memory Object, or in State Server or in SQL Server . You can read This[^] article for Detail on session. Cache store data on server and its is not user specific, so all user will get the same data.

              NidhiKanu wrote:

              o if same person log in from different computers ten wat happen.it will clash both or will some infliction occur

              I didn't get your point.:confused:

              cheers, Abhijit CodeProject MVP My Recent Article : Exploring Session in ASP.Net

              N 1 Reply Last reply
              0
              • A Abhijit Jana

                Let me clear the thing first, Caching and Session both are server side state management. Session is User Specific , Session data is stored in either Memory Object, or in State Server or in SQL Server . You can read This[^] article for Detail on session. Cache store data on server and its is not user specific, so all user will get the same data.

                NidhiKanu wrote:

                o if same person log in from different computers ten wat happen.it will clash both or will some infliction occur

                I didn't get your point.:confused:

                cheers, Abhijit CodeProject MVP My Recent Article : Exploring Session in ASP.Net

                N Offline
                N Offline
                NidhiKanu
                wrote on last edited by
                #7

                i mean if any user login through same userid and password from different 2 location then wat will happen N!dh! :)

                N 1 Reply Last reply
                0
                • N NidhiKanu

                  i mean if any user login through same userid and password from different 2 location then wat will happen N!dh! :)

                  N Offline
                  N Offline
                  N a v a n e e t h
                  wrote on last edited by
                  #8

                  Cache data will be available to both of them.

                  Navaneeth How to use google | Ask smart questions

                  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