Created
May 30, 2013 11:52
-
-
Save relax-more/5677326 to your computer and use it in GitHub Desktop.
[HTTP] session, cookie に関してよくわかってなかったのでまとめ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
明確な違いは | |
session は、Dataをserver 上に保持している | |
cookie は、Dataをclient 上に保持している | |
という点。 | |
session はserver のメモリ上に保持されているがcookie はlocal に保存される。 | |
cookie のファイルはブラウザ別に保存される。 | |
http://oshiete.goo.ne.jp/qa/2375010.html | |
以下余談 | |
■ session を利用する際の問題点 | |
sesion にデータを保持する場合、client に session_id を保持し、対応するデータはsession_id を | |
利用してserver から習得するため、ロードバランサによって別のserver に振り分けられるとDataが習得できない場合がある? | |
ただし、L4のロードバランサは、 同一IPからのリクエストは同じサーバに転送するなどTCP/IPレベルでのセッション維持機能を利用することができる。らしい。 | |
http://e-connerie.com/?p=12 | |
(ロードバランサにパーシステンシの設定ができるらしい) | |
http://www.infraexpert.com/study/loadbalancer5.html | |
■ Cookieを利用する場合の問題点 | |
CookieはLocalの情報なので、悪意あるUserに更新される事がある | |
※CookieはHTTP Header に設定されて通信されるので、SSLの設定がされている環境で使えばCookieで通信する情報も暗号化され、だいぶ安心 | |
■Cookieの利用できる範囲に関して | |
http://www.imymode.com/exp/cookie.html | |
■セキュリティにかんする話題であとで読むメモ | |
http://www.drk7.jp/MT/archives/000966.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment