Ç°¶Ë¿ª·¢ÖÐCookieÄÇЩʶù
Ç°¶Îʱ¼ä×öÁËÏîÄ¿£¬ÔÚÇ°¶ËʵÏÖÖÐƵ·±µÄ²Ù×÷cookie£¬¼Ç¼¼¸µã¹©´ó¼Ò²Î¿¼£¡
cookie²Ù×÷ÔÚÇ°¶Ë¿ª·¢¹ý³ÌÖо³£Óöµ½£¬µ±È»Èç¹ûÖ»ÊÇÓÃÀ´´æ´¢Ò»Ð©¼òµ¥Óû§Êý¾Ý£¬»¹ÊDZȽϼòµ¥µÄ£¬ÎÒÃÇÒª×öµÄ¿ÉÄÜÖ»ÊÇÉèÖÃcookieÃû£¬Öµ£¬¹ýÆÚʱ¼äµÈ£¬¶ÁÈ¡Ò²Ö»Òª¸ù¾ÝcookieµÄÃû¶ÁÈ¡ÏàÓ¦µÄcookieÖµ¾Í¿ÉÒÔÁË¡£ÔÚ¸´ÔÓµÄÓ¦ÓÃÖУ¬¹âÕâЩ¿Ï¶¨¾Í²»¹»ÁË¡£
cookieµÄÊôÐÔ
³ýÁËname£¨Ãû£©ºÍvalue£¨Öµ£©£¬cookie»¹ÓÐÒÔÏÂһЩ¿ÉÑ¡ÊôÐÔ£¬ÓÃÀ´¿ØÖÆcookieµÄÓÐЧÆÚ£¬×÷ÓÃÓò£¬°²È«ÐԵȣº
expiresÊôÐÔ
Ö¸¶¨ÁËcookieµÄÉú´æÆÚ£¬Ä¬ÈÏÇé¿öÏÂcookieÊÇÔÝʱ´æÔڵģ¬ËûÃÇ´æ´¢µÄÖµÖ»ÔÚä¯ÀÀÆ÷»á»°ÆÚ¼ä´æÔÚ£¬µ±Óû§Í˳öä¯ÀÀÆ÷ºóÕâЩֵҲ»á¶ªÊ§£¬Èç¹ûÏëÈÃcookie´æÔÚÒ»¶Îʱ¼ä£¬¾ÍҪΪexpiresÊôÐÔÉèÖÃΪδÀ´µÄÒ»¸öÓúÁÃëÊý±íʾµÄ¹ýÆÚÈÕÆÚ»òʱ¼äµã£¬expiresĬÈÏΪÉèÖõÄexpiresµÄµ±Ç°Ê±¼ä¡£ÏÖÔÚÒѾ±»max-ageÊôÐÔËùÈ¡´ú£¬max-ageÓÃÃëÀ´ÉèÖÃcookieµÄÉú´æÆÚ¡£
Èç¹ûmax-ageÊôÐÔΪÕýÊý£¬Ôò±íʾ¸Ãcookie»áÔÚmax-ageÃëÖ®ºó×Ô¶¯Ê§Ð§¡£ä¯ÀÀÆ÷»á½«max-ageΪÕýÊýµÄcookie³Ö¾Ã»¯£¬¼´Ð´µ½¶ÔÓ¦µÄcookieÎļþÖС£ÎÞÂÛ¿Í»§¹Ø±ÕÁËä¯ÀÀÆ÷»¹ÊǵçÄÔ£¬Ö»Òª»¹ÔÚmax-ageÃë֮ǰ£¬µÇ¼Íøվʱ¸ÃcookieÈÔÈ»ÓÐЧ¡£
Èç¹ûmax-ageΪ¸ºÊý£¬Ôò±íʾ¸Ãcookie½öÔÚ±¾ä¯ÀÀÆ÷´°¿ÚÒÔ¼°±¾´°¿Ú´ò¿ªµÄ×Ó´°¿ÚÄÚÓÐЧ£¬¹Ø±Õ´°¿Úºó¸Ãcookie¼´Ê§Ð§¡£max-ageΪ¸ºÊýµÄCookie£¬ÎªÁÙʱÐÔcookie£¬²»»á±»³Ö¾Ã»¯£¬²»»á±»Ð´µ½cookieÎļþÖС£cookieÐÅÏ¢±£´æÔÚä¯ÀÀÆ÷ÄÚ´æÖУ¬Òò´Ë¹Ø±Õä¯ÀÀÆ÷¸Ãcookie¾ÍÏûʧÁË¡£cookieĬÈϵÄmax-ageֵΪ-1¡£
Èç¹ûmax-ageΪ0£¬Ôò±íʾɾ³ý¸Ãcookie¡£cookie»úÖÆûÓÐÌṩɾ³ýcookieµÄ·½·¨£¬Òò´Ëͨ¹ýÉèÖøÃcookie¼´Ê±Ê§Ð§ÊµÏÖɾ³ýcookieµÄЧ¹û¡£Ê§Ð§µÄCookie»á±»ä¯ÀÀÆ÷´ÓcookieÎļþ»òÕßÄÚ´æÖÐɾ³ý¡£
Èç¹û²»ÉèÖÃexpires»òÕßmax-ageÕâ¸öcookieĬÈÏÊÇSessionµÄ£¬Ò²¾ÍÊǹرÕä¯ÀÀÆ÷¸Ãcookie¾ÍÏûʧÁË¡£
ÍƼöÐÅÏ¢
- ¹¹½¨¸ß¿ÉÓú͵¯ÐÔÉìËõµÄKV´æ´¢ÏµÍ³
- ̸̸ÍøÕ¾¾²Ì¬»¯£¨¶þ£©
- ̸̸ÍøÕ¾¾²Ì¬»¯£¨Ò»£©
- Ðì¹úÏ飺΢²©ÊÇ·ñ»á²ÎÓëÍøÕ¾ÅÅÃû
- ApacheÔÚ±¾µØ½¨Á¢·ºÓòÃûÐéÄâÖ÷»ú¼ò·¨
- ÈçºÎ½øÐÐÍøÕ¾Õï¶Ï ΪÍøÕ¾½øÐÐÆÀ·Ö
- Ò»¸ö³É¹¦µÄÕ¾³¤Ó¦¸Ã¾ß±¸µÄËØÖÊ
- Ò»Ìõ΢²©Òý·¢µÄ·ÖÎö£ºÈçºÎÈÃ΢²©µÃµ½¹ã·º´«²¥
- ÈçºÎÈÃÒ»¸öÍøÕ¾ÓÐÇ¿´óÉúÃüÁ¦
- פ×ãIDCÃż÷³Ö±Ò¹ÛÍû Õ¾³¤Ñ¡¹º¿Õ¼ä³É¡°¼èÄѵľö¶¨¡±£¿
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
ÆÀÂÛ