11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 18 • SESSION HANDLERSwww.it-ebooks.infosession.cache_limiter directive modifies these pages’ cache-related headers, providing instructionsregarding caching preference. Its prototype follows:session.cache_limiter = stringFive values are available:• none: This setting disables the transmission of any cache control headersalong with the session-enabled pages.• nocache: This is the default setting. This setting ensures that every request isfirst sent to the originating server for confirmation that the page has notchanged before a potentially cached version is offered.• private: Designating a cached document as private means that the documentwill be made available only to the originating user, instructing proxies to notcache the page and therefore not share it with other users.• private_no_expire: This variation of the private designation results in nodocument expiration date being sent to the browser. Otherwise identical tothe private setting, this was added as a workaround for various browsers thatbecame confused by the Expire header sent along when caching is set toprivate.• public: This setting deems all documents as cacheable, making it a usefulchoice for non-sensitive areas of your site thanks to the improvement inperformance.Setting Cache Expiration Time for Session-Enabled PagesThe session.cache_expire directive determines the number of seconds (180 by default) that cachedsession pages are made available before new pages are created. Its prototype follows:session.cache_expire = integerIf session.cache_limiter is set to nocache, this directive is ignored.Setting the Session LifetimeThe session.gc_maxlifetime directive determines the duration, in seconds (by default 1440), for whichsession data is considered valid. Its prototype follows:session.gc_maxlifetime = integerOnce this limit is reached, the session information will be destroyed, allowing for the recuperationof system resources. Also check out the session.gc_divisor and session.gc_probability directives formore information about tweaking the session garbage collection feature.372

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!