开发者

Kohana 3 - Storing Sessions in Cache

开发者 https://www.devze.com 2023-04-03 06:55 出处:网络
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 ca

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

精彩评论

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

关注公众号