cookie和session的作用及其区别(国外英文资料).docVIP

  • 28
  • 0
  • 约1.8万字
  • 约 17页
  • 2017-06-05 发布于河南
  • 举报

cookie和session的作用及其区别(国外英文资料).doc

cookie和session的作用及其区别(国外英文资料)

cookie和session的作用及其区别 The difference between a cookie mechanism and a session mechanism In particular, the cookie mechanism USES a program that maintains state on the client side, while the session mechanism USES a program that maintains state on the server side. At the same time we also see, as on the server side to maintain state of solutions on the client side also need to keep a logo, so the session mechanism may rely on the cookie mechanism to achieve the purpose of save the logo, but in fact there are other options. The difference between session cookies and persistent cookies If the expiration time is not set, the cookie will disappear when the browser window is turned off during the browser session. This lifetime is called session cookies for browsing session cookies. Session cookies are typically not kept on the hard disk but in memory. If set the expiration date, the browser will keep the cookies on the hard drive, open the browser again after closing, these cookies are still valid until the expiration time more than set. Cookies stored on a hard disk can be Shared between different browser processes, such as two IE Windows. Different browsers have different ways of handling cookies stored in memory How do you use the automatic login When a user registers on a site, he receives a cookie with a unique user ID. Client reconnects later, this user ID will be automatically returned, server check about it and determine whether it is for registered users and chose the automatic login, and users dont need to clear the user name and password, you can access the server resources. How to customize the site according to the users liking The site can use cookies to record the users wishes. For simple Settings, the site can store the pages Settings directly in the cookie. However, for more complex custom, just only send a unique identifier to the user, the server database storage each identifier corresponding page setup. Five, the cookies sent 1. Create a Cookie object

文档评论(0)

1亿VIP精品文档

相关文档