State Management in ASP.NET part-1 (Cookies)

Hi,I am Back with State Management Series.

In this post we are going to Talk about Cookies. After Reading this, you must be able to do following things:

  • Create Cookie
  • Access Cookie
  • Can answer Some Basic Q & A about Cookie

What is Need of Cookie?

Cookies are Required to Store Temporary data in Users system which may be Required during Session or after Session.

How Many Type of Cookie are there?
Cookies are generally of Two Type. Session wide or Persistent. Sessional cookies Expire as soon as User Closed Session means Browser. Persistent cookies expire after Defined Time. This can be Defined at the Time of Creation.

Who Make Cookies?

Cookie is always made by Application (Server) in Users/ Clients Browser and stored in Hard Disk of User. These are used to store Users Customized Appearance, other Values , Login Time etc for future Retrieval so that website can server him better.

Limitations of Cookie?

Cookies are open Invitations to Hackers.

Cookies can only store Little and Only String Type Data.

Now Lets Learn with Coding. First We will Create a Cookie named myCookie and Solve Earlier Problem with the Help of Cookie.
Now Code is Like Below:

Now Check….

Don’t forget to add me on Google+, +John Bhatt .

Have any Question or Comment?

2 comments on “State Management in ASP.NET part-1 (Cookies)

Leave a Reply

Your email address will not be published. Required fields are marked *