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. Does session works if we disable cookies

Does session works if we disable cookies

Scheduled Pinned Locked Moved ASP.NET
hosting
4 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.
  • K Offline
    K Offline
    kpsetty
    wrote on last edited by
    #1

    :confused:hi all, one of my friend is telling that, session doesn't works if the the client disable the cookies in his computer.he is telling that while moving from one webpage to another webpage, the session hold the datas in the cookies.i disabled the cookies in my browser and fetch the data from cookie, it works, but my friend is telling that it wont work after hosting the site. please the well known persons clarify me. krisshnaprabhu

    G 1 Reply Last reply
    0
    • K kpsetty

      :confused:hi all, one of my friend is telling that, session doesn't works if the the client disable the cookies in his computer.he is telling that while moving from one webpage to another webpage, the session hold the datas in the cookies.i disabled the cookies in my browser and fetch the data from cookie, it works, but my friend is telling that it wont work after hosting the site. please the well known persons clarify me. krisshnaprabhu

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      There are two types of cookies; session cookies and regular cookies. Session cookies are stored in the browser while regular cookies are stored as a file on client's computer. If you don't specify an expiration date for a cookie, it becomes a session cookie. The web server stores the id of the Session object in a session cookie to be able to keep track of the user. When you disable cookies in the browser it's usually only regular cookies that you disable, not session cookies, so the session handling will still work. However, if you disable all cookies in the browser, session handling won't work. --- b { font-weight: normal; }

      R A 2 Replies Last reply
      0
      • G Guffa

        There are two types of cookies; session cookies and regular cookies. Session cookies are stored in the browser while regular cookies are stored as a file on client's computer. If you don't specify an expiration date for a cookie, it becomes a session cookie. The web server stores the id of the Session object in a session cookie to be able to keep track of the user. When you disable cookies in the browser it's usually only regular cookies that you disable, not session cookies, so the session handling will still work. However, if you disable all cookies in the browser, session handling won't work. --- b { font-weight: normal; }

        R Offline
        R Offline
        Red Stateler
        wrote on last edited by
        #3

        Guffa wrote:

        However, if you disable all cookies in the browser, session handling won't work.

        In asp.net 2.0, you can set the cookieless attribute in the sessionState element (webconfig) to false or autodetect, and asp will automatically put a session identifier in the URL to maintain session. Cookieless sessions are definately possible.

        1 Reply Last reply
        0
        • G Guffa

          There are two types of cookies; session cookies and regular cookies. Session cookies are stored in the browser while regular cookies are stored as a file on client's computer. If you don't specify an expiration date for a cookie, it becomes a session cookie. The web server stores the id of the Session object in a session cookie to be able to keep track of the user. When you disable cookies in the browser it's usually only regular cookies that you disable, not session cookies, so the session handling will still work. However, if you disable all cookies in the browser, session handling won't work. --- b { font-weight: normal; }

          A Offline
          A Offline
          April Fans
          wrote on last edited by
          #4

          Hi, try the following function, Write Cookies : HttpCookie cookie = System.Web.HttpContext.Current.Request.Cookies[CookieName]; if(cookie !=null) { System.Web.HttpContext.Current.Request.Cookies[CookieName].Value = CookieValue; System.Web.HttpContext.Current.Request.Cookies[CookieName].Expires = DataTime.Now.AddMonths(12); } else { cookie = new HttpCookie(cookiesName); cookie.Value = CookiesValue; cookie.Expires = DateTime.Now.AddMonths(12); System.Web.HttpContext.Current.Response.Cookies.Add(cookie);

          April Comm100 - Leading Live Chat Software Provider

          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