Thursday, September 21, 2006

Catalyst Session State

我们一般使用 cookie 来保存 sessionid, 如果 cookie 失效的话就用 url 来传递 sessionid.
这个在 Catalyst 里非常简单。我们能同时使用 State::URI 和 State::Cookie 模块。
use Catalyst qw/
-Debug
Dumper
Config::ConfigLoader
Static::Simple
Authentication
Authentication::Store::DBIC
Authentication::Credential::Password
Session
Session::Store::DBIC
Session::State::URI
Session::State::Cookie
/;
将 URI 放在 Cookie 的前面。Session::State::URI 会判断有没有 load State::Cookie 而且 cookie 有没有效。如果 cookie 有效就使用 cookie, 无效就使用 uri.

perfect solution!

2 Comments:

Anonymous mike said...

终于找到能留言的地方了
你的BLOG我很喜欢。
希望以后多多联系
我也是搞编程的

9/23/2006 12:08 AM  
Blogger Fayland said...

nice to see u. :)

9/26/2006 4:04 PM  

Post a Comment

Links to this post:

Create a Link

<< Home