How browser resolves the cookies
-
Hi, Iam basically from C# background and very new to ASP.Net. I was trying to understand Cookie management in ASP.Net. I have a doubt in this regard. How will the client(the web browser) maintains so many cookies and how exactly it resolves the appropriate cookie to be sent along with the request message? Thanks in advance Vivek
-
Hi, Iam basically from C# background and very new to ASP.Net. I was trying to understand Cookie management in ASP.Net. I have a doubt in this regard. How will the client(the web browser) maintains so many cookies and how exactly it resolves the appropriate cookie to be sent along with the request message? Thanks in advance Vivek
The cookies are maintained separately for each domain name. The browser will send back all the cookies for the domain name in each request to the server. As all the cookies are sent every time, you should of course keep them at a minimum. The browser also has a limit on the total size of the cookies per domain name, and different browsers have different limits. A typical value for the limit is 4 kb, but it may be more or less. If you are in danger of reaching the limit, you are of course using way too many cookies.
--- b { font-weight: normal; }
-
The cookies are maintained separately for each domain name. The browser will send back all the cookies for the domain name in each request to the server. As all the cookies are sent every time, you should of course keep them at a minimum. The browser also has a limit on the total size of the cookies per domain name, and different browsers have different limits. A typical value for the limit is 4 kb, but it may be more or less. If you are in danger of reaching the limit, you are of course using way too many cookies.
--- b { font-weight: normal; }
Thanks for the reply. But this raises another question.If i have 2 instance of the web application running on my system,then will the cookies of one instance be over written by the cookies of another instance? If no, how exactly will the browser resolve the cookie associated with the webpage. Thanks
-
Thanks for the reply. But this raises another question.If i have 2 instance of the web application running on my system,then will the cookies of one instance be over written by the cookies of another instance? If no, how exactly will the browser resolve the cookie associated with the webpage. Thanks
If you have two web applications on your system, they will have different domain names, or you can't reach them individually. If you for an example use the built-in server in Visual Studio, it will use different port numbers for the instances, so localhost:6474 and localhost:3466 will be separate domain names.
--- b { font-weight: normal; }