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