Does session use cookies in ASP.NET? RRS feed

  • General discussion

  • Hi,

      The above Question is very clear. When I search in forums,  some stated that session is stored in memory and hence it wont use cookies. Some other tells that session use cookies to store SessionID. Which is correct? Please explain me clearly.

    Viswa V

    Tuesday, November 27, 2012 10:39 AM

All replies

  • The ASP.NET forums are a better place for such questions: http://forums.asp.net

    Tuesday, November 27, 2012 10:43 AM
  • The answer is Yes and No.

    Cookies can be blocked by the user, storage space is limited to four 20Kb cookies per domain, only strings can be used, paths can cause confusion, and the data is normally passed as plain text in the HTTP header. Often, cookies can be overkill for client-side-heavy applications that need to save temporary state data.

    Fortunately, there is a solution that allows you to store JavaScript data within the browser. The data is retained between page loads, it’ll survive page back/next events (even away from the domain), it does not require plugins or off-line storage facilities, it’ll hold at several megabytes of information, it is never transmitted to the server, and works in every browser. Bizarrely, it works by exploiting the window.name property (or window.top.name if you’re using multiple frames).

    It’s rare for developers set the window.name property. Generally, it’s only required when you’re manipulating frames or pop-up windows. Even though I’d hope you weren’t doing that, you do not normally need to define a name for an application’s starting window. Although the name property is still a string, it can hold several megabytes of data. Some versions of Opera limit it to around 2Mb but most browsers offer 10MB or more.

    If you get your question answered, please come back and Alternate TextMark As Answer.
    Web Developer

    Tuesday, November 27, 2012 10:58 AM