Application scope in php Application scope in php php php

Application scope in php


If you want to share it across all requests on a per user basis, using sessions is probably the way to go.

If you want to share it across all requests of all users, you have to store it in the database, on disk or keep it in memory, e.g. using memcache or memcached.


Some extensions, like APC or Zend Cache allow you to mimic application-scope.
If none are available to you, you can cache the object in a file or DB.