Explain the limitation & issues with the Cookies?

Limitation & Issues with Cookies
Using cookies gives you excellent state management capabilities, as they are simple to implement, and they help you move resources off the server. Like almost any particular technique, cookies have some limitations.

Some Users Dont Allow Cookies
Some users believe that viruses can be sent in a cookie and will not allow them onto their computers. Although there have never been any documented cases of this happening, and no one could realistically send a virus through a cookie, a lot of users still turn off the ability to accept cookies. When this happens, the user will not be able to use your site if you use cookies for managing state.

Performance Can Deteriorate
Imagine that a user walks through a wizard on your site, as you gather 100 pieces of data from that user over several pages. Each page needs to post gathered data to the server. If you wait until all 100 pieces of data are gathered, you need to store that data somewhere in the meantime. If you keep putting data into a cookie, there is a lot of data being sent back and forth between the browser and the server. This will eat up a lot of bandwidth and could slow your whole site down. Remember, the data has to go both ways for each page the users hit on your site.

Cookies Take Up Memory
Some browsers impose a limit on the size of the cookie data they can accept, or the number of cookies they can accept at one time. In addition, the amount of memory that you may chew up on the users machine may cause their operating system to swap some memory to disk. Under this circumstance, the cookie has slowed down your users machine as well as the server.

What is cookies?

Cookies are small pieces of text, stored on the client’s computer to be used only by the website setting the cookies. This allows webapplications to save information for the user, and then re-use it on each page if needed.

What are the five different ways of handling state in ASP.Net Web forms?

You can handle state in ASP.NET Web applications by using :

  • Cookies
  • Query strings
  • Hidden fields
  • Session
  • Application objects

How do you turn off your cookies for one page on your site?

It can be Turn Off by mentioning Cookies state=false in Web.Config file.

If cookies is disabled in client browser will session work ?

If cookieless is true it will work. If it is not, it won’t work.

How does ASP.NET store SessionIDs by default?

In cookies,

The DateTime type is a non-nullable value type, and just like an integer, it cannot be assigned to null.

Is there any limit of cookies can be used in a website. If yes, how many?

Yes. It’s there. we can have upto 20 cookies per website.