[1] [[HTTP]] の[[要求]]や[[応答]]はそもそも1組ずつそれぞれ独立したものですが、 複数の[[要求]]と[[応答]]の組の間にわたって[RUBYB[[[状態]]]@en[state]]を持たせたいことがあります。 その[[要求]]と[[応答]]の集合によって構成される[RUBYB[文脈]@en[context]]を[DFN[[RUBYB[セッション]@en[session]]]]といいます。 * 仕様書 - [2] [DEL[[[RFC 2109]]]] ([[廃止]]済み) -- [CSECTION@en[3. STATE AND SESSIONS]] - [3] [[RFC 2965]] -- [CSECTION@en[2. STATE AND SESSIONS]] * 仕様書から [4] > This document describes a way to create stateful sessions with HTTP requests and responses. Currently, HTTP servers respond to each client request without relating that request to previous or subsequent requests; [DEL(rfc2965)[the technique]] [INS(rfc2965)[the state management mechanism]] allows clients and servers that wish to exchange state information to place HTTP requests and responses within a larger context, which we term a "session". This context might be used to create, for example, a "shopping cart", in which user selections can be aggregated before purchase, or a magazine browsing system, in which a user's previous reading affects which offerings are presented. この文書は [[HTTP]] の[[要求]]と[[応答]]で[RUBYB[[[状態]]を持った[[セッション]]]@en[stateful session]]を作る方法を説明します。 現在、[[HTTP]] [[鯖]]は[[クライアント]]の[[要求]]それぞれに対して、 以前や以後の[[要求]]と関連付けすることなく[[応答]]しています。 [DEL(rfc2965)[この技術]][INS(rfc2965)[この状態管理機構]]によって、 [RUBYB[[[状態]]]@en[state]]情報を交換したいと思う[[クライアント]]や[[鯖]]は、 [[HTTP]] の[[要求]]や[[応答]]の群をより大きな[RUBYB[文脈]@en[context]]に配置できるようになります。 この文脈を[DFN[[RUBYB[セッション]@en[context]]]]と呼びます。 この文脈は例えば「[[買い物籠]]」といって利用者が選択したものを購入前に集めておくために使うことができますし、 雑誌閲覧システムで[[利用者]]の閲覧履歴に基づきどの雑誌を候補として提示するかを決めるために使うこともできます。 [DEL(rfc2965)[ > There are, of course, many different potential contexts and thus many different potential types of session. The designers' paradigm for sessions created by the exchange of cookies has these key attributes: = Each session has a beginning and an end. = Each session is relatively short-lived. = Either the user agent or the origin server may terminate a session. = The session is implicit in the exchange of state information. もちろん文脈となり得るものは色々ありますし、ひいては[[セッション]]の種類も色々となるでしょう。 [[Cookie]] の交換によって作られる[[セッション]]の設計者のパラダイムにはいくつか鍵となる属性がありmさう。 = 各[[セッション]]には始まりと終わりがあります。 = 各[[セッション]]は比較的短期間で終わります。 = [[利用者エージェント]]と[[起源鯖]]のどちらが[[セッション]]を終了させても構いません。 = [[セッション]]は[[状態]]情報の交換の中に暗示的に存在します。 ]DEL] [INS(rfc2965)[ > Neither clients nor servers are required to support cookies. A server MAY refuse to provide content to a client that does not return the cookies it sends. [[クライアント]]と[[鯖]]のいずれも、[[Cookie]] への対応は必須ではありません。 [[鯖]]は、自身が送信した [[Cookie]] を返さない[[クライアント]]に[[内容]]を提供することを拒んでも[['''構いません''']]。 ]INS] ** License [5] [[RFCのライセンス]]