CakeFest 2024: The Official CakePHP Conference

WinCache セッションハンドラ

WinCache セッションハンドラ (WinCache 1.1.0 以降で使用可能) を使うと、 PHP のセッションデータを共有メモリ上のセッションキャッシュに格納できるようになります。 デフォルトのファイル保存方式のかわりに共有メモリを使うことで、 大量のデータをセッションで扱う PHP アプリケーションのパフォーマンスを向上させることができます。 Wincache のセッションキャッシュはファイルをバックに置いた共有メモリなので、 IIS アプリケーションプールをリサイクルするときにもセッションのデータが失われません。

PHP で WinCache セッションハンドラを使うには、php.inisession.save_handlerwincache にします。デフォルトでは、Windows のテンポラリファイルと同じ場所にセッションデータを保存します。 セッションファイルの場所を変えるには session.save_path ディレクティブを設定します。

例1 WinCache セッションハンドラの有効化

session.save_handler = wincache
session.save_path = C:\inetpub\temp\session\

add a note

User Contributed Notes 2 notes

up
2
sethm at uoregon dot edu
13 years ago
Just as an fyi to anyone who has similar issues. WinCache v1.1.x would not write sessions to files under certain conditions. This means that all sessions are lost whenever an app-pool recycle occur. Here is the work around:

If your app-pool name has periods (.) in it, change them to underscores (_). So an app-pool named www.somesite.com should be renamed to www_somesite_com.

You can see the discussion here:
http://forums.iis.net/p/1171996/1957839.aspx#1957839
up
-3
some at email dot com
12 years ago
IF you use Apache and Session not work add to FCGID

DefaultInitEnv APP_POOL_ID "DefaultAppPool"
To Top