Skip to content

idrees04/CookiesDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CookiesDemo

COOKIES IN ASP.NET MVC

  1. Cookies are one of the State Management techniques, so that we can store information for later use. Cookies are small files that are created in the web browser's memory (if they're temporary) or on the client's hard drive (if they're permanent).
  2. Cookies are used to store small pieces of information related to a user’s computer, such as its IP address, browser type, operating system, and Web pages last visited.
  3. The purpose of storing this information is to offer a personalized experience to the user.
  4. Cookies are sent to a client computer along with the page output.
  5. These cookies are stored on the client’s computer.
  6. When a browser requests the same page the next time, it sends the cookie along with the request information.
  7. The Web server reads the cookie and extracts its value.
  8. It then, process the Web page according to the information contained in the cookie and renders it on the Web browser.
  9. There are two types of cookies:
  10. SESSION OR NON-PERSISTENT COOKIE. (TEMPORARY)
  11. PERSISTENT COOKIE (PERMANENT)
  12. SESSION OR NON-PERSISTENT COOKIE:
  13. The first one is the session cookies that are stored in the browser’s memory that are transmitted through the header during every request.
  14. Session cookies are temporary cookies and remain saved for current session only. PERSISTENT COOKIE:
  15. The other type of cookie is the persistent cookies that are stored in text files on a user’s computer. This type of cookie is useful when you need to store information for a longtime.
  16. Persistent cookies are created for the duration, which is set in the cookie file. DIFFERENCE BETWEEN COOKIES AND SESSION.
  17. COOKIES
  18. Cookies are used for client side state management.
  19. It means cookies are stored in the client machine browser.
  20. SESSION
  21. Sessions are used for server side state management.
  22. It means sessions are stored in the server machine.