{"id":802,"date":"2025-08-04T16:22:26","date_gmt":"2025-08-04T07:22:26","guid":{"rendered":"https:\/\/nexive.tech\/?p=802"},"modified":"2025-08-04T16:22:26","modified_gmt":"2025-08-04T07:22:26","slug":"%e3%80%90%e3%82%b5%e3%82%af%e3%83%83%e3%81%a8%e8%a7%a3%e8%aa%ac%e3%80%91php-%e3%82%bb%e3%83%83%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%81%a8%e3%82%bb%e3%82%ad%e3%83%a5","status":"publish","type":"post","link":"https:\/\/nexive.tech\/?p=802","title":{"rendered":"\u3010\u30b5\u30af\u30c3\u3068\u89e3\u8aac\u3011PHP \u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u4f7f\u3044\u65b9\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">1. \u672c\u8a18\u4e8b\u306e\u30dd\u30a4\u30f3\u30c8<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PHP\u306b\u304a\u3051\u308b\u30bb\u30c3\u30b7\u30e7\u30f3\u7ba1\u7406\u306e\u57fa\u672c\u3068\u4f7f\u3044\u65b9\u3092\u6574\u7406<\/li>\n\n\n\n<li>\u30bb\u30c3\u30b7\u30e7\u30f3ID\u306e\u6271\u3044\u65b9\u3084\u518d\u751f\u6210\u306e\u5b9f\u88c5\u65b9\u6cd5\u3092\u7d39\u4ecb<\/li>\n\n\n\n<li>\u5b9f\u52d9\u3067\u8003\u616e\u3059\u3079\u304d\u30bb\u30c3\u30b7\u30e7\u30f3\u95a2\u9023\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56\u3092\u89e3\u8aac<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">2. PHP\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u3068\u306f\uff1f<\/h2>\n\n\n\n<p>PHP\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u3068\u306f\u3001\u8907\u6570\u306eHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u9593\u3067\u30e6\u30fc\u30b6\u306e\u72b6\u614b\u3092\u7dad\u6301\u3059\u308b\u4ed5\u7d44\u307f\u3067\u3059\u3002\u305f\u3068\u3048\u3070\u30ed\u30b0\u30a4\u30f3\u60c5\u5831\u3084\u30ab\u30fc\u30c8\u306e\u4e2d\u8eab\u306a\u3069\u3001\u30d6\u30e9\u30a6\u30b6\u3092\u307e\u305f\u3044\u3067\u30b5\u30fc\u30d0\u5074\u3067\u7ba1\u7406\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u60c5\u5831\u306b\u4f7f\u308f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>PHP\u3067\u306f <code>$_SESSION<\/code> \u30b9\u30fc\u30d1\u30fc\u30b0\u30ed\u30fc\u30d0\u30eb\u3092\u901a\u3058\u3066\u30bb\u30c3\u30b7\u30e7\u30f3\u5909\u6570\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002\u30bb\u30c3\u30b7\u30e7\u30f3\u306f\u4e3b\u306bCookie\u306b\u683c\u7d0d\u3055\u308c\u305f\u30bb\u30c3\u30b7\u30e7\u30f3ID\uff08SID\uff09\u3092\u3082\u3068\u306b\u8b58\u5225\u3055\u308c\u3001\u30b5\u30fc\u30d0\u5074\u306b\u4fdd\u5b58\u3055\u308c\u305f\u5024\u304c\u5bfe\u5fdc\u3065\u3051\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30bb\u30c3\u30b7\u30e7\u30f3\u7ba1\u7406\u306f\u30ed\u30b0\u30a4\u30f3\u8a8d\u8a3c\u3084\u30e6\u30fc\u30b6\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u306a\u3069\u591a\u304f\u306eWeb\u30a2\u30d7\u30ea\u306b\u6b20\u304b\u305b\u306a\u3044\u8981\u7d20\u3067\u3059\u3002\u4e00\u65b9\u3067\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u30cf\u30a4\u30b8\u30e3\u30c3\u30af\u3084\u56fa\u5b9a\u30bb\u30c3\u30b7\u30e7\u30f3ID\u306a\u3069\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u9762\u3067\u306e\u30ea\u30b9\u30af\u3082\u542b\u307e\u308c\u308b\u305f\u3081\u3001\u6b63\u3057\u304f\u5b89\u5168\u306b\u4f7f\u3046\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. \u8a73\u7d30\u89e3\u8aac<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u57fa\u672c\u7684\u306a\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u4f7f\u3044\u65b9<\/h3>\n\n\n\n<p>\u6700\u3082\u57fa\u672c\u7684\u306a\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u5229\u7528\u65b9\u6cd5\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u958b\u59cb\u306b\u306f <code>session_start()<\/code> \u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">PHP<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>&lt;?php\n\/\/ \u30bb\u30c3\u30b7\u30e7\u30f3\u958b\u59cb\nsession_start();\n\n\/\/ \u5024\u306e\u4fdd\u5b58\n$_SESSION&#91;'username'&#93; = 'user1';\n\n\/\/ \u5024\u306e\u53d6\u5f97\necho $_SESSION&#91;'username'&#93;; \/\/ \u51fa\u529b: user1\n?>\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D4D4D4\">&lt;?php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ \u30bb\u30c3\u30b7\u30e7\u30f3\u958b\u59cb<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">session_start<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ \u5024\u306e\u4fdd\u5b58<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">$_SESSION<\/span><span style=\"color: #D4D4D4\">&#91;<\/span><span style=\"color: #CE9178\">&#39;username&#39;<\/span><span style=\"color: #D4D4D4\">&#93; = <\/span><span style=\"color: #CE9178\">&#39;user1&#39;<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ \u5024\u306e\u53d6\u5f97<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">echo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">$_SESSION<\/span><span style=\"color: #D4D4D4\">&#91;<\/span><span style=\"color: #CE9178\">&#39;username&#39;<\/span><span style=\"color: #D4D4D4\">&#93;; <\/span><span style=\"color: #6A9955\">\/\/ \u51fa\u529b: user1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">?&gt;<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p><code>session_start()<\/code> \u306f\u5fc5\u305aHTML\u51fa\u529b\u3088\u308a\u524d\u306b\u547c\u3073\u51fa\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30d8\u30c3\u30c0\u9001\u4fe1\u5f8c\u306b\u547c\u3076\u3068\u8b66\u544a\u304c\u51fa\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30bb\u30c3\u30b7\u30e7\u30f3ID\u306e\u518d\u751f\u6210\uff08\u30bb\u30c3\u30b7\u30e7\u30f3\u56fa\u5b9a\u653b\u6483\u5bfe\u7b56\uff09<\/h3>\n\n\n\n<p>\u30bb\u30c3\u30b7\u30e7\u30f3ID\u304c\u4e88\u6e2c\u53ef\u80fd\u3060\u3068\u3001\u653b\u6483\u8005\u306b\u4e57\u3063\u53d6\u3089\u308c\u308b\u6050\u308c\u304c\u3042\u308a\u307e\u3059\u3002\u91cd\u8981\u306a\u64cd\u4f5c\u5f8c\u306b\u306f\u30bb\u30c3\u30b7\u30e7\u30f3ID\u3092\u518d\u751f\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">PHP<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>&lt;?php\nsession_start();\n\n\/\/ \u30ed\u30b0\u30a4\u30f3\u6210\u529f\u5f8c\u306a\u3069\u306bID\u518d\u751f\u6210\nsession_regenerate_id(true); \/\/ true: \u53e4\u3044\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u524a\u9664\n?>\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D4D4D4\">&lt;?php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">session_start<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ \u30ed\u30b0\u30a4\u30f3\u6210\u529f\u5f8c\u306a\u3069\u306bID\u518d\u751f\u6210<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">session_regenerate_id<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #569CD6\">true<\/span><span style=\"color: #D4D4D4\">); <\/span><span style=\"color: #6A9955\">\/\/ true: \u53e4\u3044\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u524a\u9664<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">?&gt;<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>ID\u306e\u518d\u751f\u6210\u306f\u3001\u30ed\u30b0\u30a4\u30f3\u51e6\u7406\u5f8c\u306a\u3069\u306b\u5fc5\u305a\u884c\u3046\u3079\u304d\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u7834\u68c4\uff08\u30ed\u30b0\u30a2\u30a6\u30c8\u51e6\u7406\u306a\u3069\uff09<\/h3>\n\n\n\n<p>\u30ed\u30b0\u30a2\u30a6\u30c8\u6642\u306f\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u4e2d\u8eab\u3092\u30af\u30ea\u30a2\u3057\u3001ID\u3092\u7121\u52b9\u5316\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">PHP<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>&lt;?php\nsession_start();\n\n\/\/ \u30bb\u30c3\u30b7\u30e7\u30f3\u5909\u6570\u306e\u5168\u524a\u9664\n$_SESSION = array();\n\n\/\/ \u30bb\u30c3\u30b7\u30e7\u30f3\u30af\u30c3\u30ad\u30fc\u306e\u524a\u9664\nif (ini_get(\"session.use_cookies\")) {\n    $params = session_get_cookie_params();\n    setcookie(session_name(), '', time() - 42000,\n        $params&#91;\"path\"&#93;, $params&#91;\"domain\"&#93;,\n        $params&#91;\"secure\"&#93;, $params&#91;\"httponly\"&#93;\n    );\n}\n\n\/\/ \u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u7834\u68c4\nsession_destroy();\n?>\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D4D4D4\">&lt;?php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">session_start<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ \u30bb\u30c3\u30b7\u30e7\u30f3\u5909\u6570\u306e\u5168\u524a\u9664<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">$_SESSION<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #DCDCAA\">array<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ \u30bb\u30c3\u30b7\u30e7\u30f3\u30af\u30c3\u30ad\u30fc\u306e\u524a\u9664<\/span><\/span>\n<span class=\"line\"><span style=\"color: #C586C0\">if<\/span><span style=\"color: #D4D4D4\"> (<\/span><span style=\"color: #DCDCAA\">ini_get<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">&quot;session.use_cookies&quot;<\/span><span style=\"color: #D4D4D4\">)) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #9CDCFE\">$params<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #DCDCAA\">session_get_cookie_params<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #DCDCAA\">setcookie<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #DCDCAA\">session_name<\/span><span style=\"color: #D4D4D4\">(), <\/span><span style=\"color: #CE9178\">&#39;&#39;<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #DCDCAA\">time<\/span><span style=\"color: #D4D4D4\">() - <\/span><span style=\"color: #B5CEA8\">42000<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #9CDCFE\">$params<\/span><span style=\"color: #D4D4D4\">&#91;<\/span><span style=\"color: #CE9178\">&quot;path&quot;<\/span><span style=\"color: #D4D4D4\">&#93;, <\/span><span style=\"color: #9CDCFE\">$params<\/span><span style=\"color: #D4D4D4\">&#91;<\/span><span style=\"color: #CE9178\">&quot;domain&quot;<\/span><span style=\"color: #D4D4D4\">&#93;,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #9CDCFE\">$params<\/span><span style=\"color: #D4D4D4\">&#91;<\/span><span style=\"color: #CE9178\">&quot;secure&quot;<\/span><span style=\"color: #D4D4D4\">&#93;, <\/span><span style=\"color: #9CDCFE\">$params<\/span><span style=\"color: #D4D4D4\">&#91;<\/span><span style=\"color: #CE9178\">&quot;httponly&quot;<\/span><span style=\"color: #D4D4D4\">&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    );<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ \u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u7834\u68c4<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">session_destroy<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">?&gt;<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u306e\u51e6\u7406\u3092\u884c\u3046\u3053\u3068\u3067\u3001\u30ed\u30b0\u30a2\u30a6\u30c8\u5f8c\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u518d\u5229\u7528\u3092\u9632\u3052\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. \u3088\u304f\u3042\u308b\u30df\u30b9\u30fb\u8aa4\u89e3\u30fb\u843d\u3068\u3057\u7a74<\/h2>\n\n\n\n<p>\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u6271\u3046\u969b\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5b9f\u52d9\u7684\u306a\u30df\u30b9\u304c\u898b\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>session_start()<\/code> \u3092HTML\u51fa\u529b\u5f8c\u306b\u5b9f\u884c\u3057\u3066\u30a8\u30e9\u30fc\u306b\u306a\u308b\uff08\u30d8\u30c3\u30c0\u9001\u4fe1\u524d\u304c\u5fc5\u9808\uff09<\/li>\n\n\n\n<li>\u30bb\u30c3\u30b7\u30e7\u30f3ID\u306e\u56fa\u5b9a\u306b\u3088\u308a\u3001CSRF\u3084\u30cf\u30a4\u30b8\u30e3\u30c3\u30af\u306e\u6e29\u5e8a\u3068\u306a\u308b<\/li>\n\n\n\n<li>HTTPS\u901a\u4fe1\u4e0b\u3067 <code>secure<\/code> \u30d5\u30e9\u30b0\u3092\u4ed8\u3051\u3066\u3044\u306a\u3044\uff08\u4e2d\u9593\u8005\u653b\u6483\u306e\u5bfe\u8c61\u306b\uff09<\/li>\n\n\n\n<li>\u30ed\u30b0\u30a2\u30a6\u30c8\u51e6\u7406\u3067 <code>session_destroy()<\/code> \u3060\u3051\u5b9f\u884c\u3057\u3001Cookie\u306e\u524a\u9664\u3092\u5fd8\u308c\u308b<\/li>\n<\/ul>\n\n\n\n<p>\u307e\u305f\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u5909\u6570\u306b\u76f4\u63a5\u30e6\u30fc\u30b6\u5165\u529b\u3092\u683c\u7d0d\u3059\u308b\u8a2d\u8a08\u3082\u907f\u3051\u308b\u3079\u304d\u3067\u3059\u3002\u7279\u306b\u6a29\u9650\u60c5\u5831\u3084\u30d5\u30e9\u30b0\u7b49\u306e\u691c\u8a3c\u306a\u3057\u8aad\u307f\u51fa\u3057\u306f\u30ea\u30b9\u30af\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">5. \u307e\u3068\u3081<\/h2>\n\n\n\n<p>PHP\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u306f\u72b6\u614b\u7ba1\u7406\u306b\u4e0d\u53ef\u6b20\u306a\u4ed5\u7d44\u307f\u3067\u3059\u304c\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3092\u610f\u8b58\u3057\u306a\u3044\u904b\u7528\u306f\u8106\u5f31\u6027\u3092\u62db\u304d\u307e\u3059\u3002<code>session_start()<\/code> \u3084 <code>session_regenerate_id()<\/code> \u306e\u6b63\u3057\u3044\u4f7f\u3044\u65b9\u3001\u30ed\u30b0\u30a2\u30a6\u30c8\u6642\u306e\u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\u51e6\u7406\u306a\u3069\u3092\u7406\u89e3\u3057\u3001\u5b89\u5168\u306a\u8a2d\u8a08\u30fb\u5b9f\u88c5\u3092\u5fc3\u304c\u3051\u307e\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u672c\u8a18\u4e8b\u306e\u30dd\u30a4\u30f3\u30c8 2. PHP\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u3068\u306f\uff1f PHP\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u3068\u306f\u3001\u8907\u6570\u306eHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u9593\u3067\u30e6\u30fc\u30b6\u306e\u72b6\u614b\u3092\u7dad\u6301\u3059\u308b\u4ed5\u7d44\u307f\u3067\u3059\u3002\u305f\u3068\u3048\u3070\u30ed\u30b0\u30a4\u30f3\u60c5\u5831\u3084\u30ab\u30fc\u30c8\u306e\u4e2d\u8eab\u306a\u3069\u3001\u30d6\u30e9\u30a6\u30b6\u3092\u307e\u305f\u3044\u3067\u30b5\u30fc\u30d0\u5074\u3067\u7ba1\u7406\u3059\u308b\u5fc5 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":718,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[85],"tags":[],"class_list":["post-802","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/802","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=802"}],"version-history":[{"count":2,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/802\/revisions"}],"predecessor-version":[{"id":883,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/802\/revisions\/883"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/media\/718"}],"wp:attachment":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=802"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=802"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}