Catalystで携帯対応セッション

はじめてやってみた。
普段は qw/Session Session::Store::FastMmap Session::State::Cookie/のコンボだったんだけど

qw/Session Session::Store::FastMmap Session::State::URI/にしてみて携帯対応にしてみた。
携帯なんかだとクッキーつかえないっていうんで、URLにセッションIDを付加する。
configには下記のように

  session => {
    param => 'sid',
    verify_address => 'true',
},

これでURLの最後に?sidでセッションIDを付加してくれます。
終わり(はやっ)

Catalyst::Plugin::Session::State::URI
にか以下のように記載されています。

Session Hijacking
URI sessions are very prone to session hijacking problems.

Make sure your users know not to copy and paste URIs to prevent these problems, and always provide a way to safely link to public resources.

Also make sure to never link to external sites without going through a gateway page that does not have session data in it's URI, so that the external site doesn't get any session IDs in the http referrer header.

Due to these issues this plugin should be used as a last resort, as Catalyst::Plugin::Session::State::Cookie is more appropriate 99% of the time.

Take a look at the IP address limiting features in Catalyst::Plugin::Session to see make some of these problems less dangerous.


excite翻訳で

セッションハイジャック
URIセッションは非常にセッションハイジャック問題の傾向があります。

あなたのユーザがこれらの問題を防ぐためにコピーとペーストのURIに知らないのを確実にしてください、そして、いつも安全に共同資金にリンクする方法を前提としてください。また、それがURIであることを決して外部のサイトへのそれがセッションデータを持っていないゲートウェイページに直面していなくてどんなリンクにも確実にしないでください、外部のサイトがhttp referrerヘッダーで少しのセッションIDも得ないように。
これらの問題のため、このpluginはCatalystとして最後の手段として使用されるべきです:、:Plugin:、:セッション:、:以下を述べてください:クッキーは99%の割合で、より適切です。
IPへの一見が制限しながら記述する撮影はCatalystで以下を特集します:Plugin:、:これらの問題のいくつかをより危険でなくするように確実にするセッション。

ん文章が微妙にわけわかめ
このPluginは最後の手段にしてくださいだそうです。

expiresを短めに
expires => 3600,

verify_address => 'true',

When true, <$c-request->address>> will be checked at prepare time. If it is not the same as the address that initiated the session, the session is deleted.

って事で時間チェックして、いかさま防止してくれるっぽい?