{"id":9056,"date":"2020-01-31T11:59:44","date_gmt":"2020-01-31T03:59:44","guid":{"rendered":"http:\/\/www.zhushiyao.com\/?p=9056"},"modified":"2020-01-31T12:05:54","modified_gmt":"2020-01-31T04:05:54","slug":"3b18cab7ac","status":"publish","type":"post","link":"http:\/\/www.zhushiyao.com\/?p=9056","title":{"rendered":"\u5e72\u6389\u670d\u52a1\u72b6\u6001\uff01\u4ece Session \u5230 Token"},"content":{"rendered":"<div class=\"bpp-post-content\">\n<section style=\"display: none;\"><\/section>\n<section style=\"font-size: 16px;\">\n<section>\n<section>\n<section>\n<blockquote class=\"js_blockquote_wrap\">\n<section class=\"js_blockquote_digest\">\n<section style=\"text-align: left;\"><span style=\"color: #0052ff;\"><strong><span style=\"font-size: 14px;\">\u6765\u81ea\u516c\u4f17\u53f7\uff1a<\/span><\/strong><strong><span style=\"font-family: -apple-system-font, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; text-align: start; font-size: 14px;\">\u4f1a\u70b9\u4ee3\u7801\u7684\u5927\u53d4<\/span><\/strong><\/span><\/section>\n<\/section>\n<\/blockquote>\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; font-family: Helvetica, Arial, sans-serif; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u5728\u8bb2Token\u4e4b\u524d\uff0c\u5148\u7b80\u5355\u8bf4\u8bf4\u4ec0\u4e48\u662f Session \u548c Cookie\u3002<\/span><\/p>\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; font-family: Helvetica, Arial, sans-serif; text-align: left;\">\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; font-family: Helvetica, Arial, sans-serif; text-align: left;\"><span style=\"color: #f97353; font-size: 15px;\">\u9996\u5148\u8981\u77e5\u9053 HTTP \u8bf7\u6c42\u662f\u65e0\u72b6\u6001\u7684\uff1b<\/span><\/p>\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; font-family: Helvetica, Arial, sans-serif; text-align: left;\">\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; font-family: Helvetica, Arial, sans-serif; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u65e0\u72b6\u6001\u7684\u610f\u601d\u5c31\u662f\uff1a\u6bcf\u4e00\u6b21\u8bf7\u6c42\u90fd\u662f\u72ec\u7acb\u7684\uff1b\u6bcf\u4e00\u6b21\u8bf7\u6c42\u4e0d\u4f1a\u53d7\u5230\u524d\u9762\u8bf7\u6c42\u7684\u5f71\u54cd\uff0c\u4e5f\u4e0d\u4f1a\u5f71\u54cd\u540e\u9762\u7684\u8bf7\u6c42\uff1b<\/span><\/p>\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; font-family: Helvetica, Arial, sans-serif; text-align: left;\">\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; font-family: Helvetica, Arial, sans-serif; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u6bd4\u5982\u6211\u4eec\u767b\u5f55\u4e00\u4e2a\u7cfb\u7edf\u7684\u65f6\u5019\uff0c\u9a8c\u8bc1\u7528\u6237\u540d\u5bc6\u7801\u4e4b\u540e\uff0c\u6253\u5f00\u7cfb\u7edf\u5404\u4e2a\u9875\u9762\u7684\u65f6\u5019\u5c31\u4e0d\u9700\u8981\u518d\u8fdb\u884c\u767b\u5f55\u64cd\u4f5c\u4e86\uff0c\u76f4\u5230\u6211\u4eec\u4e3b\u52a8\u9000\u51fa\u767b\u5f55\u6216\u8d85\u65f6\u9000\u51fa\u767b\u5f55\uff1b\u4e3a\u4e86\u8ba9\u670d\u52a1\u5668\u6709\u201c\u8bb0\u5fc6\u529f\u80fd\u201d\uff0c\u6211\u4eec\u53ef\u4ee5\u7528\u5230 Session\u3001Cookie\u3002<\/span><\/p>\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; font-family: Helvetica, Arial, sans-serif;\">\n<section style=\"max-width: 100%; font-size: 16px; white-space: normal; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"max-width: 100%; text-align: center; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"padding-right: 10px; padding-left: 10px; display: inline-block; max-width: 100%; box-sizing: border-box; background-color: #fefefe; overflow-wrap: break-word !important;\"><span style=\"max-width: 100%; font-size: 28px; color: #3c949f; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><strong style=\"max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;\">01<\/strong><\/span><\/section>\n<section style=\"margin-top: -1.2em; margin-bottom: 0.65em; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"margin-right: auto; margin-left: auto; max-width: 100%; box-sizing: border-box; border-top: 1px solid #212122; border-right-color: #212122; border-bottom-color: #212122; border-left-color: #212122; width: 114.797px; height: 1px; overflow: hidden; overflow-wrap: break-word !important;\"><\/section>\n<\/section>\n<p style=\"max-width: 100%; min-height: 1em; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><span style=\"max-width: 100%; color: #3c949f; font-size: 16px; font-weight: bold; letter-spacing: 2px; text-align: center; box-sizing: border-box !important; overflow-wrap: break-word !important;\">Cookie<\/span><\/p>\n<\/section>\n<\/section>\n<p style=\"margin-right: 10px; margin-left: 10px; max-width: 100%; min-height: 1em; font-size: 16px; white-space: normal; line-height: 1.75em; font-family: Helvetica, Arial, sans-serif; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; font-family: Helvetica, Arial, sans-serif; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u662f\u5728\u5ba2\u6237\u7aef(\u6d4f\u89c8\u5668)\u4fdd\u5b58\u7528\u6237\u4fe1\u606f\u7684\u4e00\u79cd\u673a\u5236\uff1bCookie \u7531\u670d\u52a1\u5668\u751f\u6210\uff0c\u53d1\u9001\u7ed9\u6d4f\u89c8\u5668\uff0c\u7136\u540e\u6d4f\u89c8\u5668\u628a Cookie \u4ee5\u952e\u503c\u5bf9\u7684\u5f62\u5f0f\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u7684\u67d0\u4e2a\u76ee\u5f55\u4e0b\u9762\uff1b\u6bcf\u79cd\u6d4f\u89c8\u5668\u5b58\u50a8\u5927\u5c0f\u4f1a\u6709\u4e00\u4e9b\u5dee\u5f02\uff0c\u4e00\u822c\u4e0d\u8d85\u8fc7 <\/span><span style=\"font-size: 15px;\"><span style=\"line-height: inherit; color: #3c949f;\">4KB<\/span><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif;\">\uff1b<\/span><\/span><\/p>\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; font-family: Helvetica, Arial, sans-serif; text-align: left;\">\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; font-family: Helvetica, Arial, sans-serif; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u5f53\u4e0b\u4e00\u6b21\u8bf7\u6c42\u7684\u65f6\u5019\uff0c\u4f1a\u628a Cookie \u53d1\u9001\u7ed9\u670d\u52a1\u7aef\uff0c\u670d\u52a1\u7aef\u5bf9 Cookie \u4e2d\u7684\u4fe1\u606f\u89e3\u6790\u5e76\u9a8c\u8bc1\u8eab\u4efd\u3002<\/span><\/p>\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; font-family: Helvetica, Arial, sans-serif; text-align: left;\">\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; font-family: Helvetica, Arial, sans-serif; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u6bd4\u5982\u4f60\u5165\u804c\u4e00\u4e2a\u516c\u53f8\uff0c\u4f1a\u7ed9\u4f60\u529e\u4e00\u5f20\u5de5\u5361\uff0c\u4e0a\u9762\u6709\u4f60\u7684\u59d3\u540d\u3001\u5de5\u53f7\u3001\u90e8\u95e8\u7b49\u4fe1\u606f\uff0c\u4f60\u8fdb\u5165\u804c\u573a\u7684\u65f6\u5019\uff0c\u62ff\u7740\u5de5\u5361\u5c31\u53ef\u4ee5\u8fdb\u51fa\u3002<\/span><\/p>\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; font-family: Helvetica, Arial, sans-serif; text-align: left;\">\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; font-family: Helvetica, Arial, sans-serif; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u4f46\u662f Cookie \u662f\u4e0d\u53ef\u4ee5\u8de8\u57df\u540d\u4f7f\u7528\u7684\uff1b\u5c31\u597d\u50cf\u6211\u62ff\u7740\u6211\u4eec\u516c\u53f8\u7684\u5de5\u5361\uff0c\u53bb\u4f60\u4eec\u516c\u53f8\uff0c\u4fdd\u5b89\u80af\u5b9a\u662f\u4e0d\u4f1a\u653e\u6211\u8fdb\u53bb\u7684\u3002<\/span><\/p>\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em;\">\n<section style=\"max-width: 100%; font-size: 16px; white-space: normal; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"max-width: 100%; text-align: center; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"padding-right: 10px; padding-left: 10px; display: inline-block; max-width: 100%; box-sizing: border-box; background-color: #fefefe; overflow-wrap: break-word !important;\"><span style=\"max-width: 100%; font-size: 28px; color: #3c949f; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><strong style=\"max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;\">02<\/strong><\/span><\/section>\n<section style=\"margin-top: -1.2em; margin-bottom: 0.65em; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"margin-right: auto; margin-left: auto; max-width: 100%; box-sizing: border-box; border-top: 1px solid #212122; border-right-color: #212122; border-bottom-color: #212122; border-left-color: #212122; width: 114.797px; height: 1px; overflow: hidden; overflow-wrap: break-word !important;\"><\/section>\n<\/section>\n<p style=\"max-width: 100%; min-height: 1em; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><span style=\"max-width: 100%; color: #3c949f; font-size: 16px; font-weight: bold; letter-spacing: 2px; text-align: center; box-sizing: border-box !important; overflow-wrap: break-word !important;\">Session<\/span><\/p>\n<\/section>\n<\/section>\n<p style=\"margin-right: 10px; margin-left: 10px; max-width: 100%; min-height: 1em; font-size: 16px; white-space: normal; line-height: 1.75em; font-family: Helvetica, Arial, sans-serif; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"font-family: Helvetica, Arial, sans-serif;\">\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u4fdd\u5b58\u5728\u670d\u52a1\u7aef\uff0c\u53ef\u4ee5\u7528\u4e8e\u8bb0\u5f55\u5ba2\u6237\u72b6\u6001\uff1b<\/span><\/p>\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; text-align: left;\">\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u6bd4\u5982\u6211\u4eec\u7ecf\u5e38\u4f1a\u7528 Session \u4fdd\u5b58\u5ba2\u6237\u7684\u57fa\u672c\u4fe1\u606f\u3001\u6743\u9650\u4fe1\u606f\u7b49\uff1b\u7528\u6237\u7b2c\u4e00\u6b21\u767b\u5f55\u4e4b\u540e\uff0c\u670d\u52a1\u5668\u5c31\u4f1a\u521b\u5efa\u4e00\u4e2a Session \uff0c\u5e76\u5c06 SessionID \u8fd4\u56de\u7ed9\u6d4f\u89c8\u5668\uff0c\u6d4f\u89c8\u5668\u901a\u5e38\u5c06\u5176\u5199\u5165\u5230 Cookie \u4e2d\uff0c\u8fd9\u79cd Cookie \u4e5f\u53eb\u505a SessionCookie \uff0c\u6d4f\u89c8\u5668\u518d\u6b21\u8bbf\u95ee\u65f6\uff0c\u53ea\u9700\u8981\u62ff\u7740 SessionID \u4ece\u670d\u52a1\u7aef\u67e5\u627e Session \u5c31\u53ef\u4ee5\u4e86\u3002<\/span><\/p>\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; text-align: left;\">\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u53e6\u5916\uff0c\u8fd9\u4e2a SessionID \u4e0d\u4e00\u5b9a\u975e\u8981\u4fdd\u5b58\u5230 Cookie \u4e2d\uff0c\u53ea\u662f\u5bf9\u4e8e\u6d4f\u89c8\u5668\u5ba2\u6237\u7aef\uff0c\u5927\u5bb6\u7684\u9ed8\u8ba4\u505a\u6cd5\u662f\u653e\u5728 Cookie \u4e2d\u3002<\/span><\/p>\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em;\">\n<section style=\"max-width: 100%; font-size: 16px; white-space: normal; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"max-width: 100%; text-align: center; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"padding-right: 10px; padding-left: 10px; display: inline-block; max-width: 100%; box-sizing: border-box; background-color: #fefefe; overflow-wrap: break-word !important;\"><span style=\"max-width: 100%; font-size: 28px; color: #3c949f; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><strong style=\"max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;\">03<\/strong><\/span><\/section>\n<section style=\"margin-top: -1.2em; margin-bottom: 0.65em; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"margin-right: auto; margin-left: auto; max-width: 100%; box-sizing: border-box; border-top: 1px solid #212122; border-right-color: #212122; border-bottom-color: #212122; border-left-color: #212122; width: 114.797px; height: 1px; overflow: hidden; overflow-wrap: break-word !important;\"><\/section>\n<\/section>\n<p style=\"max-width: 100%; min-height: 1em; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><span style=\"max-width: 100%; color: #3c949f; font-size: 16px; font-weight: bold; letter-spacing: 2px; text-align: center; box-sizing: border-box !important; overflow-wrap: break-word !important;\">Cookie \u548c Session<\/span><\/p>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"text-align: center; margin-left: 10px; margin-right: 10px;\">\n<section style=\"font-family: Helvetica, Arial, sans-serif;\">\n<section>\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u5173\u4e8e Cookie \u548c Session \u7684\u533a\u522b\uff0c\u5f88\u591a\u540c\u5b66\u4f1a\u56de\u7b54\uff1a\u201cCookie \u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\uff0cSession \u4fdd\u5b58\u5728\u670d\u52a1\u5668\u7aef\u201d\uff0c\u5176\u5b9e\u8fd9\u6837\u7684\u60f3\u6cd5\u5e76\u4e0d\u5168\u9762\uff1a<\/span><\/p>\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\">\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">Cookie \u662f\u4e00\u4e2a\u5b9e\u9645\u5b58\u5728\u7684\u7684\u4e1c\u897f\uff0c\u4e00\u4e2a\u5f88\u5177\u4f53\u7684\u4e1c\u897f\uff0c\u5c31\u662f\u4e00\u6bb5\u6570\u636e\uff0c\u800c Session \u662f\u4e00\u4e2a\u62bd\u8c61\u6982\u5ff5\uff0c\u6216\u8005\u53eb\u505a\u6a21\u5f0f\u65b9\u6cd5\uff0c\u5b83\u6709\u5f88\u591a\u5b9e\u73b0\u65b9\u6848\uff1b<\/span><\/p>\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\">\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\"><span style=\"font-size: 15px;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif;\">\u6bd4\u5982<\/span><span style=\"line-height: inherit; color: #3c949f;\"> Tomcat \u7684\u5b9e\u73b0\u65b9\u6cd5<\/span><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif;\">\uff1a\u628a\u72b6\u6001\u4fdd\u5b58\u5728\u670d\u52a1\u7aef\uff0c\u7136\u540e\u751f\u6210\u4e00\u4e2a JSESSIONID \u653e\u5728 Cookie \u4e2d\uff1b\u8bf7\u6c42\u8fc7\u6765\u4e4b\u540e\uff0c\u62ff\u7740 JSESSIONID \u5728\u670d\u52a1\u5668\u7aef\u67e5\u8be2\u5e76\u9a8c\u8bc1\u72b6\u6001\u3002<\/span><\/span><\/p>\n<section>\n<p style=\"margin-right: 10px; margin-left: 10px; line-height: 1.75em;\">\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages js_insertlocalimg\" title=\"\u5e72\u6389\u670d\u52a1\u72b6\u6001\uff01\u4ece Session \u5230 Token\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2020\/01\/4-1580443184.jpeg\" alt=\"\u5e72\u6389\u670d\u52a1\u72b6\u6001\uff01\u4ece Session \u5230 Token\" \/><\/p>\n<p style=\"text-align: center;\">\n<section style=\"font-family: Helvetica, Arial, sans-serif;\">\n<section style=\"max-width: 100%; font-size: 16px; white-space: normal; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"max-width: 100%; text-align: center; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"padding-right: 10px; padding-left: 10px; display: inline-block; max-width: 100%; box-sizing: border-box; background-color: #fefefe; overflow-wrap: break-word !important;\"><span style=\"max-width: 100%; font-size: 28px; color: #3c949f; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><strong style=\"max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;\">04<\/strong><\/span><\/section>\n<section style=\"margin-top: -1.2em; margin-bottom: 0.65em; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"margin-right: auto; margin-left: auto; max-width: 100%; box-sizing: border-box; border-top: 1px solid #212122; border-right-color: #212122; border-bottom-color: #212122; border-left-color: #212122; width: 114.797px; height: 1px; overflow: hidden; overflow-wrap: break-word !important;\"><\/section>\n<\/section>\n<p style=\"max-width: 100%; min-height: 1em; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><span style=\"max-width: 100%; color: #3c949f; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: bold; letter-spacing: 2px; text-align: center; box-sizing: border-box !important; overflow-wrap: break-word !important;\">Token<\/span><\/p>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"margin-right: 10px; margin-left: 10px; text-align: center;\">\n<\/section>\n<section>\n<section>\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u5f53\u7136\uff0c\u968f\u7740\u7528\u6237\u91cf\u7684\u589e\u52a0\uff0c\u4fdd\u5b58\u5728\u670d\u52a1\u7aef\u7684 Session \u4e5f\u4e0d\u65ad\u589e\u52a0\uff0c\u8fd9\u7ed9\u670d\u52a1\u7aef\u5e26\u6765\u4e86\u5f88\u5927\u7684\u538b\u529b\uff0c\u5e76\u4e14\u5982\u679c\u7a0b\u5e8f\u662f\u96c6\u7fa4\u6216\u5206\u5e03\u5f0f\u65b9\u5f0f\u90e8\u7f72\uff0c\u540c\u4e00\u4e2a\u7528\u6237\u7b2c\u4e00\u6b21\u8bf7\u6c42\uff0c\u8bbf\u95ee\u5230\u4e86 A \u670d\u52a1\u5668\uff0c\u521b\u5efa\u4e86 Session\uff0c\u4f46\u662f\u7b2c\u4e8c\u6b21\u8bf7\u6c42\u5374\u53d1\u5230\u4e86 B \u670d\u52a1\u5668\u4e0a\uff0c\u4f46\u662f B \u670d\u52a1\u5668\u4e0a\u5e76\u6ca1\u6709\u4e4b\u524d\u521b\u5efa\u7684 Session\uff1b\u8fd9\u5c31\u662f\u5206\u5e03\u5f0f\u67b6\u6784\u4e2d\u7684 Session \u5171\u4eab\u95ee\u9898\u3002<\/span><\/p>\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\">\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u9488\u5bf9\u8fd9\u4e2a\u95ee\u9898\uff0c\u6211\u4eec\u53ef\u4ee5\u8fdb\u884c\u670d\u52a1\u5668\u4e4b\u95f4\u7684 Session \u540c\u6b65\uff0c\u6216\u8005\u5e72\u8106\u628a Session \u4fdd\u5b58\u5230\u7b2c\u4e09\u65b9\u7684\u7ec4\u4ef6\u4e2d\uff0c\u4f8b\u5982\u4fdd\u5b58\u5230 Redis \u4e2d\uff1b\u4f46\u662f\u4e0d\u7ba1\u662f\u54ea\u79cd\u65b9\u6848\uff0c\u90fd\u8ba9 Session \u53d8\u6210\u4e86\u9879\u76ee\u7684\u8d1f\u62c5\u3002<\/span><\/p>\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\">\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u8fd9\u65f6\u5019\uff0c\u670d\u52a1\u7aef\u5c31\u4f1a\u60f3\uff0c\u5982\u679c Session \u4e0d\u4fdd\u5b58\u5728\u6211\u8fd9\u91cc\u591a\u597d\uff0c\u7b2c\u4e00\u6b21\u53d1\u9001\u7528\u6237\u540d\u5bc6\u7801\u7ed9\u6211\uff0c\u9a8c\u8bc1\u901a\u8fc7\u540e\u6211\u7ed9\u4f60\u4e00\u4e2a\u901a\u884c\u8bc1\uff0c\u4ee5\u540e\u5ba2\u6237\u7aef\u6bcf\u6b21\u8bf7\u6c42\u7684\u65f6\u5019\u5c31\u5e26\u7740\u8fd9\u4e2a\u901a\u884c\u8bc1\uff1b<\/span><\/p>\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\">\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u8fd9\u4e2a\u901a\u884c\u8bc1\u5c31\u662f token\uff0c\u5f53\u7136\u8fd9\u4e2a\u9a8c\u8bc1\u7ed3\u679c\u4e2d\u9700\u8981\u5305\u542b\u5ba2\u6237\u7aef\u4fe1\u606f\uff0c\u670d\u52a1\u7aef\u9700\u8981\u77e5\u9053\u8bf7\u6c42\u662f\u8c01\u53d1\u8fc7\u6765\u7684\uff1b\u8fd8\u9700\u8981\u5305\u542b\u65f6\u95f4\u4fe1\u606f\uff0c\u56e0\u4e3a\u901a\u884c\u8bc1\u4e0d\u53ef\u80fd\u6c38\u8fdc\u6709\u6548\uff1b\u901a\u884c\u8bc1\u8fd8\u4e0d\u80fd\u662f\u660e\u6587\u7684\uff0c\u5426\u5219\u4f1a\u6709\u88ab\u622a\u83b7\u7684\u98ce\u9669\u3002<\/span><\/p>\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\">\n<p style=\"text-align: left;\">\n<p style=\"margin-left: 10px; margin-right: 10px;\">\n<\/section>\n<\/section>\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\"><span style=\"color: #f97353; font-size: 15px;\">HMAC-SHA1\uff1a<\/span><\/p>\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">token = user_id|expiry_date|HMAC(user_id|expiry_date, k)<\/span><\/p>\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\">\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\"><span style=\"color: #f97353; font-size: 15px;\">AES\uff1a<\/span><\/p>\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">token = AES(user_id|expiry_date, x)<\/span><\/p>\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\">\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\"><span style=\"color: #f97353; font-size: 15px;\">RSA\uff1a<\/span><\/p>\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">token = RSA(user_id|expiry_date, private key)<\/span><\/p>\n<p style=\"margin-left: 10px; margin-right: 10px;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages js_insertlocalimg\" title=\"\u5e72\u6389\u670d\u52a1\u72b6\u6001\uff01\u4ece Session \u5230 Token\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2020\/01\/1-1580443184.jpeg\" alt=\"\u5e72\u6389\u670d\u52a1\u72b6\u6001\uff01\u4ece Session \u5230 Token\" \/><\/p>\n<p style=\"text-align: center;\">\n<section style=\"font-family: Helvetica, Arial, sans-serif;\">\n<section style=\"max-width: 100%; font-size: 16px; white-space: normal; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"max-width: 100%; text-align: center; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"padding-right: 10px; padding-left: 10px; display: inline-block; max-width: 100%; box-sizing: border-box; background-color: #fefefe; overflow-wrap: break-word !important;\"><span style=\"max-width: 100%; font-size: 28px; color: #3c949f; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><strong style=\"max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;\">05<\/strong><\/span><\/section>\n<section style=\"margin-top: -1.2em; margin-bottom: 0.65em; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"margin-right: auto; margin-left: auto; max-width: 100%; box-sizing: border-box; border-top: 1px solid #212122; border-right-color: #212122; border-bottom-color: #212122; border-left-color: #212122; width: 114.797px; height: 1px; overflow: hidden; overflow-wrap: break-word !important;\"><\/section>\n<\/section>\n<p style=\"max-width: 100%; min-height: 1em; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><span style=\"max-width: 100%; color: #3c949f; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: bold; letter-spacing: 2px; text-align: center; box-sizing: border-box !important; overflow-wrap: break-word !important;\">SSO \u5355\u70b9\u767b\u5f55<\/span><\/p>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"margin-right: 10px; margin-left: 10px; text-align: center;\">\n<section style=\"font-family: Helvetica, Arial, sans-serif; font-size: 16px; white-space: normal;\">\n<section>\n<p style=\"margin-right: 10px; margin-left: 10px; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u6709\u4e9b\u516c\u53f8\u4f1a\u5efa\u8bbe\u7edf\u4e00\u767b\u5f55\u7cfb\u7edf\uff08\u5355\u70b9\u767b\u5f55\uff09\uff0c\u5ba2\u6237\u7aef\u5148\u53bb\u8fd9\u4e2a\u7cfb\u7edf\u83b7\u53d6 Token \uff0c\u9a8c\u8bc1\u901a\u8fc7\u518d\u62ff\u7740\u8fd9\u4e9bToken\u53bb\u8bbf\u95ee\u5176\u4ed6\u7cfb\u7edf\uff1bAPI Gateway \u4e5f\u53ef\u4ee5\u63d0\u4f9b\u7c7b\u4f3c\u7684\u529f\u80fd\uff0c\u6211\u4eec\u516c\u53f8\u5c31\u662f\u8fd9\u6837\uff0c\u5ba2\u6237\u7aef\u63a5\u5165\u7684\u65f6\u5019\uff0c\u5148\u5411\u7f51\u5173\u83b7\u53d6 Token\uff0c\u9a8c\u8bc1\u901a\u8fc7\u4e86\u624d\u80fd\u8bbf\u95ee\u88ab\u6388\u6743\u7684\u63a5\u53e3\uff0c\u5e76\u4e14\u4e00\u6bb5\u65f6\u95f4\u540e\u8981\u91cd\u65b0\u6216\u8005 Token\u3002<\/span><\/p>\n<p style=\"margin-right: 10px; margin-left: 10px;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif;\">\u00a0<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages js_insertlocalimg\" title=\"\u5e72\u6389\u670d\u52a1\u72b6\u6001\uff01\u4ece Session \u5230 Token\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2020\/01\/1-1580443184-1.jpeg\" alt=\"\u5e72\u6389\u670d\u52a1\u72b6\u6001\uff01\u4ece Session \u5230 Token\" \/><\/p>\n<p style=\"text-align: center;\">\n<section style=\"font-family: Helvetica, Arial, sans-serif;\">\n<section style=\"max-width: 100%; font-size: 16px; white-space: normal; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"max-width: 100%; text-align: center; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"padding-right: 10px; padding-left: 10px; display: inline-block; max-width: 100%; box-sizing: border-box; background-color: #fefefe; overflow-wrap: break-word !important;\"><span style=\"max-width: 100%; font-size: 28px; color: #3c949f; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><strong style=\"max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;\">06<\/strong><\/span><\/section>\n<section style=\"margin-top: -1.2em; margin-bottom: 0.65em; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n<section style=\"margin-right: auto; margin-left: auto; max-width: 100%; box-sizing: border-box; border-top: 1px solid #212122; border-right-color: #212122; border-bottom-color: #212122; border-left-color: #212122; width: 114.797px; height: 1px; overflow: hidden; overflow-wrap: break-word !important;\"><\/section>\n<\/section>\n<p style=\"max-width: 100%; min-height: 1em; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><span style=\"max-width: 100%; color: #3c949f; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: bold; letter-spacing: 2px; text-align: center; box-sizing: border-box !important; overflow-wrap: break-word !important;\">Token \u548c Session<\/span><\/p>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"margin-right: 10px; margin-left: 10px; text-align: center;\">\n<\/section>\n<\/section>\n<section style=\"font-family: Helvetica, Arial, sans-serif; font-size: 16px; white-space: normal;\">\n<section>\n<p style=\"margin-right: 10px; margin-left: 10px; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u5bf9\u4e8e session \u548c token \uff0c\u5bf9\u6bd4\u5b83\u4eec\u6ca1\u6709\u672c\u8d28\u7684\u533a\u522b\uff0c\u4e24\u8005\u90fd\u662f\u52a0\u5bc6\u540e\u7684\u5b57\u7b26\u4e32\uff0c\u90fd\u53ef\u4ee5\u505a\u8eab\u4efd\u9a8c\u8bc1\u3002\u5f53\u7136 token \u6bd4 session \u8fd8\u662f\u6709\u4e00\u5b9a\u533a\u522b\u7684\uff0c\u6bd4\u5982 token \u8de8\u57df\u66f4\u5bb9\u6613\uff0ctoken \u66f4\u597d\u63a7\u5236\u7b49\u7b49\uff0c\u53e6\u5916\u5728\u6388\u6743\u573a\u666f\u4e0b\uff0ctoken \u6bd4 session \u6709\u7740\u66f4\u5927\u7684\u4f18\u52bf\uff1b<\/span><\/p>\n<p style=\"margin-right: 10px; margin-left: 10px; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u00a0<\/span><\/p>\n<p style=\"margin-right: 10px; margin-left: 10px; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u6bd4\u5982\uff0c\u6211\u5f00\u53d1\u4e00\u4e2a\u7f51\u7ad9\uff0c\u5141\u8bb8\u5fae\u4fe1\u7528\u6237\u767b\u5f55\uff0c\u4f7f\u7528 token \u7684\u6d41\u7a0b\u5927\u6982\u662f\u8fd9\u6837\u7684\uff1a<\/span><\/p>\n<p style=\"margin-right: 10px; margin-left: 10px;\">\n<p style=\"margin-right: 10px; margin-left: 10px; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u00a0<\/span><\/p>\n<ul class=\"list-paddingleft-2\" style=\"list-style-type: disc;\">\n<li>\n<section style=\"margin-right: 10px; margin-left: 10px; margin-bottom: 5px; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u767b\u5f55\u7f51\u7ad9\u65f6\uff0c\u8df3\u8f6c\u5230\u5fae\u4fe1\u767b\u5f55\u9875\u9762\uff1b<\/span><\/section>\n<\/li>\n<li>\n<section style=\"margin-right: 10px; margin-left: 10px; margin-bottom: 5px; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u7528\u6237\u8f93\u5165\u7528\u6237\u540d\u5bc6\u7801\u767b\u5f55\u5fae\u4fe1\u540e\uff0c\u7ed9\u6211\u4eec\u4e00\u4e2a token\uff1b<\/span><\/section>\n<\/li>\n<li>\n<section style=\"font-family: Helvetica, Arial, sans-serif; font-size: 16px; white-space: normal;\">\n<section>\n<section style=\"margin-right: 10px; margin-left: 10px; margin-bottom: 5px; text-align: left;\"><span style=\"color: #4c4c4c; line-height: 1.75em; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u7528\u6237\u62ff\u7740 token \u5c31\u53ef\u4ee5\u5728\u6211\u4eec\u7684\u7f51\u7ad9\u4f7f\u7528\uff0c\u800c\u6211\u4eec\u7f51\u7ad9\u5e76\u4e0d\u9700\u8981\u77e5\u9053\u4f60\u5fae\u4fe1\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801\u3002<\/span><\/section>\n<\/section>\n<\/section>\n<\/li>\n<\/ul>\n<\/section>\n<\/section>\n<p style=\"margin-left: 10px; margin-right: 10px;\">\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\">\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\"><span style=\"color: #4c4c4c; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u603b\u4e4b\uff0c\u5982\u679c\u5728\u540c\u4e00\u4e2a\u7f51\u7ad9\u5185\uff0ctoken \u548c session \u5e76\u6ca1\u6709\u592a\u5927\u7684\u533a\u522b\uff0c\u5982\u679c\u8de8\u7ad9\u4f7f\u7528\uff0ctoken \u4f1a\u66f4\u65b9\u4fbf\u4e00\u4e9b\u3002<\/span><\/p>\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\"><span style=\"color: #4c4c4c; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">\u00a0<\/span><\/p>\n<p style=\"margin-left: 10px; margin-right: 10px; text-align: left;\"><span style=\"color: #4c4c4c; font-family: \u5fae\u8f6f\u96c5\u9ed1, Arial, sans-serif; font-size: 15px;\">Cookie\u3001Session \u548c Token \u5c31\u4ecb\u7ecd\u8fd9\u4e48\u591a\uff0c\u5982\u679c\u6709\u95ee\u9898\uff0c\u5927\u5bb6\u53ef\u4ee5\u52a0\u6211\u5fae\u4fe1\u6216\u8fdb\u5fae\u4fe1\u7fa4\uff0c\u54b1\u4eec\u4e00\u8d77\u8ba8\u8bba\u3002<\/span><\/p>\n<p>\u8f6c\u81ea\uff1ahttps:\/\/mp.weixin.qq.com\/s\/w9yQ323SQrYaUEGCqkD82w<\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6765\u81ea\u516c\u4f17\u53f7\uff1a\u4f1a\u70b9\u4ee3\u7801\u7684\u5927\u53d4 \u5728\u8bb2Token\u4e4b\u524d\uff0c\u5148\u7b80\u5355\u8bf4\u8bf4\u4ec0\u4e48\u662f Session \u548c Cookie\u3002 \u9996\u5148\u8981\u77e5 &hellip; <a href=\"http:\/\/www.zhushiyao.com\/?p=9056\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u5e72\u6389\u670d\u52a1\u72b6\u6001\uff01\u4ece Session \u5230 Token\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[264,99],"_links":{"self":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts\/9056"}],"collection":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9056"}],"version-history":[{"count":3,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts\/9056\/revisions"}],"predecessor-version":[{"id":9064,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts\/9056\/revisions\/9064"}],"wp:attachment":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9056"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}