开发者

Kohana 3 - Storing Sessions in Cache

In Kohana 2 I saw that you could use cache as a session storage. We have a memcache instance that we would like to use to store our sessions but do not see how you would configure the system to use cache instead of native, database开发者_Go百科 or cookie.

How do you utilize cache?


When I use Memcache as session handler I usually change session.save_handler in php.ini. You can find informations on this topic in PHP manual.

It should not be hard to write your own custom Kohana Session driver to store sessions in Memcache (if you don't want to change PHP configuration for some reason).

However, while using Memcache(d) as your session handler, you need to know few disadvantages:

  • Watch out your session size.
  • You may notice issues when you hit the memcache memory limit (in fact, sessions can be dumped - Memcache deletes something to create new sessions)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜