they are 2 types of cookies.
1)persistent Cookies & 2) Non-persistent Cookies
Persistent cookies
Persistent cookies are stored on your computer hard disk. They stay on your hard disk and
can be accessed by web servers until they are deleted or have expired.
Persistent cookies are not affected by your browser setting that deletes
temporary files when you close your browser.
Non-persistent
Non-persistent cookies are saved only while your web browser is running. They can be
used by a web server only until you close your browser. They are not
saved on your disk. Microsoft Internet Explorer 5.5 can be configured to
accept non-persistent cookies but reject persistent cookies.
and follow our code project article..
A Beginner's guide for Understanding and Implementing Cookies in ASP.NET[
^]