From 97731a0e63e2a44a82d3cfbeb38a9fb9d03b8aae Mon Sep 17 00:00:00 2001 From: laminas-bot Date: Tue, 7 May 2024 18:17:22 +0000 Subject: [PATCH] Automated deployment: Tue May 7 18:17:22 UTC 2024 1.13.0 --- index.html | 4 ++-- search/search_index.json | 2 +- sitemap.xml | 10 +++++----- sitemap.xml.gz | Bin 250 -> 251 bytes v1/manual/index.html | 8 ++++++-- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 8b65e24..44c61a5 100644 --- a/index.html +++ b/index.html @@ -516,6 +516,6 @@ diff --git a/search/search_index.json b/search/search_index.json index 144c691..34f03bb 100644 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"mezzio-session-cache πŸ‡·πŸ‡Ί Русским Π³Ρ€Π°ΠΆΠ΄Π°Π½Π°ΠΌ ΠœΡ‹, участники Laminas, Ρ€ΠΎΠ΄ΠΈΠ»ΠΈΡΡŒ ΠΈ ΠΆΠΈΠ²Π΅ΠΌ Π² Ρ€Π°Π·Π½Ρ‹Ρ… странах. Π£ ΠΌΠ½ΠΎΠ³ΠΈΡ… ΠΈΠ· нас Π΅ΡΡ‚ΡŒ Π΄Ρ€ΡƒΠ·ΡŒΡ, родствСнники ΠΈ ΠΊΠΎΠ»Π»Π΅Π³ΠΈ ΠΊΠ°ΠΊ Π² России, Ρ‚Π°ΠΊ ΠΈ Π² Π£ΠΊΡ€Π°ΠΈΠ½Π΅. НСкоторыС ΠΈΠ· нас Ρ€ΠΎΠ΄ΠΈΠ»ΠΈΡΡŒ Π² России. НСкоторыС ΠΈΠ· нас ΠΆΠΈΠ²ΡƒΡ‚ Π² России. Π£ Π½Π΅ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Ρ… Π±Π°Π±ΡƒΡˆΠΊΠΈ ΠΈ Π΄Π΅Π΄ΡƒΡˆΠΊΠΈ ΡΡ€Π°ΠΆΠ°Π»ΠΈΡΡŒ с Ρ„Π°ΡˆΠΈΡΡ‚Π°ΠΌΠΈ Π²ΠΎ Π’Ρ‚ΠΎΡ€ΠΎΠΉ ΠΌΠΈΡ€ΠΎΠ²ΠΎΠΉ Π²ΠΎΠΉΠ½Π΅. Π—Π΄Π΅ΡΡŒ Π½ΠΈΠΊΡ‚ΠΎ Π½Π΅ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΈΠ²Π°Π΅Ρ‚ Ρ„Π°ΡˆΠΈΠ·ΠΌ. Π£ ΠΎΠ΄Π½ΠΎΠ³ΠΎ ΠΈΠ· нас Π΅ΡΡ‚ΡŒ украинская родствСнница, которая спаслась ΠΈΠ· Π΄ΠΎΠΌΠ° вмСстС с сыном. ПоСзд задСрТался ΠΈΠ·-Π·Π° Π±ΠΎΠΌΠ±Π΅ΠΆΠΊΠΈ Π½Π° Π΄ΠΎΡ€ΠΎΠ³Π΅ Π²ΠΏΠ΅Ρ€Π΅Π΄ΠΈ. Π£ нас Π΅ΡΡ‚ΡŒ Π΄Ρ€ΡƒΠ·ΡŒΡ, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ прячутся Π² Π±ΠΎΠΌΠ±ΠΎΡƒΠ±Π΅ΠΆΠΈΡ‰Π°Ρ…. ΠœΡ‹ с Ρ‚Ρ€Π΅Π²ΠΎΠ³ΠΎΠΉ ΠΆΠ΄Π΅ΠΌ вСсточки ΠΎΡ‚ Π½ΠΈΡ… послС Π²ΠΎΠ·Π΄ΡƒΡˆΠ½Ρ‹Ρ… Π½Π°Π»Π΅Ρ‚ΠΎΠ², ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ бСспорядочно наносят ΡƒΠ΄Π°Ρ€Ρ‹ ΠΈ ΠΏΠΎΠΏΠ°Π΄Π°ΡŽΡ‚ ΠΏΠΎ Π±ΠΎΠ»ΡŒΠ½ΠΈΡ†Π°ΠΌ, школам, дСтским садам ΠΈ Π΄ΠΎΠΌΠ°ΠΌ. ΠœΡ‹ Π½Π΅ Π±Π΅Ρ€Π΅ΠΌ это ΠΈΠ· ΠΊΠ°ΠΊΠΈΡ…-Π»ΠΈΠ±ΠΎ БМИ. ΠœΡ‹ наблюдаСм это Π½Π°ΠΏΡ€ΡΠΌΡƒΡŽ. Π’Ρ‹ довСряСтС Π½Π°ΠΌ достаточно, Ρ‡Ρ‚ΠΎΠ± ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ наши ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹, ΠΈ ΠΌΡ‹ просим вас Π΄ΠΎΠ²Π΅Ρ€ΠΈΡ‚ΡŒΡΡ Π½Π°ΠΌ вновь. ΠœΡ‹ нуТдаСмся Π² ΠΏΠΎΠΌΠΎΡ‰ΠΈ. Π’Ρ‹Ρ…ΠΎΠ΄ΠΈΡ‚Π΅ ΠΈ протСстуйтС ΠΏΡ€ΠΎΡ‚ΠΈΠ² этой бСсполСзной Π²ΠΎΠΉΠ½Ρ‹. ΠžΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚Π΅ ΠΊΡ€ΠΎΠ²ΠΎΠΏΡ€ΠΎΠ»ΠΈΡ‚ΠΈΠ΅. Π‘ΠΊΠ°ΠΆΠΈΡ‚Π΅ \"НСт Π²ΠΎΠΉΠ½Π΅!\" πŸ‡ΊπŸ‡Έ To Citizens of Russia We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism. One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences. You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say \"stop the war!\" This library provides a PSR-6 session persistence adapter for mezzio-session . Installation Run the following to install this library: $ composer require mezzio/mezzio-session-cache Documentation Browse the documentation online at https://docs.mezzio.dev/mezzio-session-cache/ Support Issues Chat Forum","title":"Home"},{"location":"#mezzio-session-cache","text":"","title":"mezzio-session-cache"},{"location":"#_1","text":"ΠœΡ‹, участники Laminas, Ρ€ΠΎΠ΄ΠΈΠ»ΠΈΡΡŒ ΠΈ ΠΆΠΈΠ²Π΅ΠΌ Π² Ρ€Π°Π·Π½Ρ‹Ρ… странах. Π£ ΠΌΠ½ΠΎΠ³ΠΈΡ… ΠΈΠ· нас Π΅ΡΡ‚ΡŒ Π΄Ρ€ΡƒΠ·ΡŒΡ, родствСнники ΠΈ ΠΊΠΎΠ»Π»Π΅Π³ΠΈ ΠΊΠ°ΠΊ Π² России, Ρ‚Π°ΠΊ ΠΈ Π² Π£ΠΊΡ€Π°ΠΈΠ½Π΅. НСкоторыС ΠΈΠ· нас Ρ€ΠΎΠ΄ΠΈΠ»ΠΈΡΡŒ Π² России. НСкоторыС ΠΈΠ· нас ΠΆΠΈΠ²ΡƒΡ‚ Π² России. Π£ Π½Π΅ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Ρ… Π±Π°Π±ΡƒΡˆΠΊΠΈ ΠΈ Π΄Π΅Π΄ΡƒΡˆΠΊΠΈ ΡΡ€Π°ΠΆΠ°Π»ΠΈΡΡŒ с Ρ„Π°ΡˆΠΈΡΡ‚Π°ΠΌΠΈ Π²ΠΎ Π’Ρ‚ΠΎΡ€ΠΎΠΉ ΠΌΠΈΡ€ΠΎΠ²ΠΎΠΉ Π²ΠΎΠΉΠ½Π΅. Π—Π΄Π΅ΡΡŒ Π½ΠΈΠΊΡ‚ΠΎ Π½Π΅ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΈΠ²Π°Π΅Ρ‚ Ρ„Π°ΡˆΠΈΠ·ΠΌ. Π£ ΠΎΠ΄Π½ΠΎΠ³ΠΎ ΠΈΠ· нас Π΅ΡΡ‚ΡŒ украинская родствСнница, которая спаслась ΠΈΠ· Π΄ΠΎΠΌΠ° вмСстС с сыном. ПоСзд задСрТался ΠΈΠ·-Π·Π° Π±ΠΎΠΌΠ±Π΅ΠΆΠΊΠΈ Π½Π° Π΄ΠΎΡ€ΠΎΠ³Π΅ Π²ΠΏΠ΅Ρ€Π΅Π΄ΠΈ. Π£ нас Π΅ΡΡ‚ΡŒ Π΄Ρ€ΡƒΠ·ΡŒΡ, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ прячутся Π² Π±ΠΎΠΌΠ±ΠΎΡƒΠ±Π΅ΠΆΠΈΡ‰Π°Ρ…. ΠœΡ‹ с Ρ‚Ρ€Π΅Π²ΠΎΠ³ΠΎΠΉ ΠΆΠ΄Π΅ΠΌ вСсточки ΠΎΡ‚ Π½ΠΈΡ… послС Π²ΠΎΠ·Π΄ΡƒΡˆΠ½Ρ‹Ρ… Π½Π°Π»Π΅Ρ‚ΠΎΠ², ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ бСспорядочно наносят ΡƒΠ΄Π°Ρ€Ρ‹ ΠΈ ΠΏΠΎΠΏΠ°Π΄Π°ΡŽΡ‚ ΠΏΠΎ Π±ΠΎΠ»ΡŒΠ½ΠΈΡ†Π°ΠΌ, школам, дСтским садам ΠΈ Π΄ΠΎΠΌΠ°ΠΌ. ΠœΡ‹ Π½Π΅ Π±Π΅Ρ€Π΅ΠΌ это ΠΈΠ· ΠΊΠ°ΠΊΠΈΡ…-Π»ΠΈΠ±ΠΎ БМИ. ΠœΡ‹ наблюдаСм это Π½Π°ΠΏΡ€ΡΠΌΡƒΡŽ. Π’Ρ‹ довСряСтС Π½Π°ΠΌ достаточно, Ρ‡Ρ‚ΠΎΠ± ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ наши ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹, ΠΈ ΠΌΡ‹ просим вас Π΄ΠΎΠ²Π΅Ρ€ΠΈΡ‚ΡŒΡΡ Π½Π°ΠΌ вновь. ΠœΡ‹ нуТдаСмся Π² ΠΏΠΎΠΌΠΎΡ‰ΠΈ. Π’Ρ‹Ρ…ΠΎΠ΄ΠΈΡ‚Π΅ ΠΈ протСстуйтС ΠΏΡ€ΠΎΡ‚ΠΈΠ² этой бСсполСзной Π²ΠΎΠΉΠ½Ρ‹. ΠžΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚Π΅ ΠΊΡ€ΠΎΠ²ΠΎΠΏΡ€ΠΎΠ»ΠΈΡ‚ΠΈΠ΅. Π‘ΠΊΠ°ΠΆΠΈΡ‚Π΅ \"НСт Π²ΠΎΠΉΠ½Π΅!\"","title":"πŸ‡·πŸ‡Ί Русским Π³Ρ€Π°ΠΆΠ΄Π°Π½Π°ΠΌ"},{"location":"#to-citizens-of-russia","text":"We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism. One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences. You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say \"stop the war!\" This library provides a PSR-6 session persistence adapter for mezzio-session .","title":"πŸ‡ΊπŸ‡Έ To Citizens of Russia"},{"location":"#installation","text":"Run the following to install this library: $ composer require mezzio/mezzio-session-cache","title":"Installation"},{"location":"#documentation","text":"Browse the documentation online at https://docs.mezzio.dev/mezzio-session-cache/","title":"Documentation"},{"location":"#support","text":"Issues Chat Forum","title":"Support"},{"location":"v1/config/","text":"Configuration This package allows configuring the following items: The PSR-6 CacheItemPoolInterface service to use. The session cookie name. The session cookie domain. The session cookie path. The session cookie secure option. The session cookie httponly option. The session cookie SameSite attribute (since 1.4.0). The cache limiter (which controls how resources using sessions are cached by the browser). When the session expires. When the resource using a session was last modified. Whether or not to create a persistent session cookie (i.e., one that will not expire when the browser is closed). This document details how to configure each of these items. Config service This package looks for a service named config that returns an array or array-like value. Inside this value, it looks for a key named mezzio-session-cache , which is expected to be an associative array or object that acts like an associative array. return [ 'mezzio-session-cache' => [ // key/value pairs ], ]; CacheItemPoolInterface By default, the factory will look for a service named Psr\\Cache\\CacheItemPoolInterface . If found, that service will be used to seed the persistence adapter. You may also provide a cache_item_pool_service configuration value. If present, this service name will be queried instead. Using a global pool To use a global cache item pool, configure the PSR-6 CacheItemPoolInterface service in your dependency configuration: use Psr\\Cache\\CacheItemPoolInterface; return [ 'dependencies' => [ 'factories' => [ CacheItemPoolInterface::class => FactoryProvidingACachePool::class, ], ], ]; Using a named pool To use a specific cache item pool: use Psr\\Cache\\CacheItemPoolInterface; return [ 'dependencies' => [ 'factories' => [ 'MoreSpecificPool' => FactoryProvidingACachePool::class, ], ], 'mezzio-session-cache' => [ 'cache_item_pool_service' => 'MoreSpecificPool', ], ]; Non-Pool configuration As noted earlier, you may configure a number of other values to customize your persistence adapter. The following is example configuration, with inline comments detailing expected and default values. use Psr\\Cache\\CacheItemPoolInterface; return [ 'mezzio-session-cache' => [ // Detailed in the above section; allows using a different // cache item pool than the global one. 'cache_item_pool_service' => CacheItemPoolInterface::class, // The name of the session cookie. This name must comply with // the syntax outlined in https://tools.ietf.org/html/rfc6265.html 'cookie_name' => 'PHPSESSION', // The (sub)domain that the cookie is available to. Setting this // to a subdomain (such as 'www.example.com') will make the cookie // available to that subdomain and all other sub-domains of it // (i.e. w2.www.example.com). To make the cookie available to the // whole domain (including all subdomains of it), simply set the // value to the domain name ('example.com', in this case). // Leave this null to use browser default (current hostname). 'cookie_domain' => null, // The path prefix of the cookie domain to which it applies. 'cookie_path' => '/', // Indicates that the cookie should only be transmitted over a // secure HTTPS connection from the client. When set to TRUE, the // cookie will only be set if a secure connection exists. 'cookie_secure' => false, // When TRUE the cookie will be made accessible only through the // HTTP protocol. This means that the cookie won't be accessible // by scripting languages, such as JavaScript. 'cookie_http_only' => false, // Available since 1.4.0 // // Asserts that a cookie must not be sent with cross-origin requests, // providing some protection against cross-site request forgery attacks (CSRF). // // Allowed values: // - Strict: The browser sends the cookie only for same-site requests // (that is, requests originating from the same site that set the cookie). // If the request originated from a different URL than the current one, // no cookies with the SameSite=Strict attribute are sent. // - Lax: The cookie is withheld on cross-site subrequests, such as calls // to load images or frames, but is sent when a user navigates to the URL // from an external site, such as by following a link. // - None: The browser sends the cookie with both cross-site and same-site // requests. 'cookie_same_site' => 'Lax', // Governs the various cache control headers emitted when // a session cookie is provided to the client. Value may be one // of \"nocache\", \"public\", \"private\", or \"private_no_expire\"; // semantics are the same as outlined in // http://php.net/session_cache_limiter 'cache_limiter' => 'nocache', // When the cache and the cookie should expire, in seconds. Defaults // to 180 minutes. 'cache_expire' => 10800, // An integer value indicating when the resource to which the session // applies was last modified. If not provided, it uses the last // modified time of, in order, // - the public/index.php file of the current working directory // - the index.php file of the current working directory // - the current working directory 'last_modified' => null, // A boolean value indicating whether or not the session cookie // should persist. By default, this is disabled (false); passing // a boolean true value will enable the feature. When enabled, the // cookie will be generated with an Expires directive equal to the // the current time plus the cache_expire value as noted above. // // As of 1.2.0, developers may define the session TTL by calling the // session instance's `persistSessionFor(int $duration)` method. When // that method has been called, the engine will use that value even if // the below flag is toggled off. 'persistent' => false, ], ]; Using the service By default, this package define the service Mezzio\\Session\\Cache\\CacheSessionPersistence , assigning it to the factory Mezzio\\Session\\Cache\\CacheSessionPersistenceFactory . After you have installed the package, you will need to tell your application to use this service when using the SessionMiddleware . The SessionMiddleware looks for the service Mezzio\\Session\\SessionPersistenceInterface . You can tell your container to use the CacheSessionPersistence in two different ways. First, you can alias it: // in config/autoload/dependencies.global.php: use Mezzio\\Session\\Cache\\CacheSessionPersistence; use Mezzio\\Session\\SessionPersistenceInterface; return [ 'dependencies' => [ 'aliases' => [ SessionPersistenceInterface::class => CacheSessionPersistence::class, ], ], ]; Second, you can instead assign the SessionPersistenceInterface service to the factory for the CacheSessionPersistence implementation: // in config/autoload/dependencies.global.php: use Mezzio\\Session\\Cache\\CacheSessionPersistenceFactory; use Mezzio\\Session\\SessionPersistenceInterface; return [ 'dependencies' => [ 'factories' => [ SessionPersistenceInterface::class => CacheSessionPersistenceFactory::class, ], ], ];","title":"Configuration"},{"location":"v1/config/#configuration","text":"This package allows configuring the following items: The PSR-6 CacheItemPoolInterface service to use. The session cookie name. The session cookie domain. The session cookie path. The session cookie secure option. The session cookie httponly option. The session cookie SameSite attribute (since 1.4.0). The cache limiter (which controls how resources using sessions are cached by the browser). When the session expires. When the resource using a session was last modified. Whether or not to create a persistent session cookie (i.e., one that will not expire when the browser is closed). This document details how to configure each of these items.","title":"Configuration"},{"location":"v1/config/#config-service","text":"This package looks for a service named config that returns an array or array-like value. Inside this value, it looks for a key named mezzio-session-cache , which is expected to be an associative array or object that acts like an associative array. return [ 'mezzio-session-cache' => [ // key/value pairs ], ];","title":"Config service"},{"location":"v1/config/#cacheitempoolinterface","text":"By default, the factory will look for a service named Psr\\Cache\\CacheItemPoolInterface . If found, that service will be used to seed the persistence adapter. You may also provide a cache_item_pool_service configuration value. If present, this service name will be queried instead.","title":"CacheItemPoolInterface"},{"location":"v1/config/#non-pool-configuration","text":"As noted earlier, you may configure a number of other values to customize your persistence adapter. The following is example configuration, with inline comments detailing expected and default values. use Psr\\Cache\\CacheItemPoolInterface; return [ 'mezzio-session-cache' => [ // Detailed in the above section; allows using a different // cache item pool than the global one. 'cache_item_pool_service' => CacheItemPoolInterface::class, // The name of the session cookie. This name must comply with // the syntax outlined in https://tools.ietf.org/html/rfc6265.html 'cookie_name' => 'PHPSESSION', // The (sub)domain that the cookie is available to. Setting this // to a subdomain (such as 'www.example.com') will make the cookie // available to that subdomain and all other sub-domains of it // (i.e. w2.www.example.com). To make the cookie available to the // whole domain (including all subdomains of it), simply set the // value to the domain name ('example.com', in this case). // Leave this null to use browser default (current hostname). 'cookie_domain' => null, // The path prefix of the cookie domain to which it applies. 'cookie_path' => '/', // Indicates that the cookie should only be transmitted over a // secure HTTPS connection from the client. When set to TRUE, the // cookie will only be set if a secure connection exists. 'cookie_secure' => false, // When TRUE the cookie will be made accessible only through the // HTTP protocol. This means that the cookie won't be accessible // by scripting languages, such as JavaScript. 'cookie_http_only' => false, // Available since 1.4.0 // // Asserts that a cookie must not be sent with cross-origin requests, // providing some protection against cross-site request forgery attacks (CSRF). // // Allowed values: // - Strict: The browser sends the cookie only for same-site requests // (that is, requests originating from the same site that set the cookie). // If the request originated from a different URL than the current one, // no cookies with the SameSite=Strict attribute are sent. // - Lax: The cookie is withheld on cross-site subrequests, such as calls // to load images or frames, but is sent when a user navigates to the URL // from an external site, such as by following a link. // - None: The browser sends the cookie with both cross-site and same-site // requests. 'cookie_same_site' => 'Lax', // Governs the various cache control headers emitted when // a session cookie is provided to the client. Value may be one // of \"nocache\", \"public\", \"private\", or \"private_no_expire\"; // semantics are the same as outlined in // http://php.net/session_cache_limiter 'cache_limiter' => 'nocache', // When the cache and the cookie should expire, in seconds. Defaults // to 180 minutes. 'cache_expire' => 10800, // An integer value indicating when the resource to which the session // applies was last modified. If not provided, it uses the last // modified time of, in order, // - the public/index.php file of the current working directory // - the index.php file of the current working directory // - the current working directory 'last_modified' => null, // A boolean value indicating whether or not the session cookie // should persist. By default, this is disabled (false); passing // a boolean true value will enable the feature. When enabled, the // cookie will be generated with an Expires directive equal to the // the current time plus the cache_expire value as noted above. // // As of 1.2.0, developers may define the session TTL by calling the // session instance's `persistSessionFor(int $duration)` method. When // that method has been called, the engine will use that value even if // the below flag is toggled off. 'persistent' => false, ], ];","title":"Non-Pool configuration"},{"location":"v1/config/#using-the-service","text":"By default, this package define the service Mezzio\\Session\\Cache\\CacheSessionPersistence , assigning it to the factory Mezzio\\Session\\Cache\\CacheSessionPersistenceFactory . After you have installed the package, you will need to tell your application to use this service when using the SessionMiddleware . The SessionMiddleware looks for the service Mezzio\\Session\\SessionPersistenceInterface . You can tell your container to use the CacheSessionPersistence in two different ways. First, you can alias it: // in config/autoload/dependencies.global.php: use Mezzio\\Session\\Cache\\CacheSessionPersistence; use Mezzio\\Session\\SessionPersistenceInterface; return [ 'dependencies' => [ 'aliases' => [ SessionPersistenceInterface::class => CacheSessionPersistence::class, ], ], ]; Second, you can instead assign the SessionPersistenceInterface service to the factory for the CacheSessionPersistence implementation: // in config/autoload/dependencies.global.php: use Mezzio\\Session\\Cache\\CacheSessionPersistenceFactory; use Mezzio\\Session\\SessionPersistenceInterface; return [ 'dependencies' => [ 'factories' => [ SessionPersistenceInterface::class => CacheSessionPersistenceFactory::class, ], ], ];","title":"Using the service"},{"location":"v1/installation/","text":"Cache Implementation Required To use this component, a PSR-6 CacheItemPoolInterface implementation is required. laminas-cache provides the PSR-6 implementations, install it and choose one of the cache adapters. Install laminas-cache and a Cache Adapter Install laminas-cache via Composer : $ composer require laminas/laminas-cache laminas-cache is shipped without a specific cache adapter to allow free choice of storage backends and their dependencies. For example, install the laminas-cache Filesystem adapter : $ composer require laminas/laminas-cache-storage-adapter-filesystem Read More in the laminas-cache Documentation PSR-6 Cache Adapters","title":"Installation"},{"location":"v1/installation/#cache-implementation-required","text":"To use this component, a PSR-6 CacheItemPoolInterface implementation is required. laminas-cache provides the PSR-6 implementations, install it and choose one of the cache adapters.","title":"Cache Implementation Required"},{"location":"v1/intro/","text":"Introduction This component provides a PSR-6 session persistence adapter for use with mezzio-session . PSR-6 defines cache items and cache item pools. This package uses a cache item pool in which to store and retrieve sessions. PSR-6 was chosen over the simpler PSR-16 as it specifically provides functionality around expiry , which allows us to expire sessions. Usage Generally, you will only provide configuration for this service, including configuring a PSR-6 CacheItemPoolInterface service; mezzio-session will then consume it via its SessionMiddleware .","title":"Introduction"},{"location":"v1/intro/#introduction","text":"This component provides a PSR-6 session persistence adapter for use with mezzio-session . PSR-6 defines cache items and cache item pools. This package uses a cache item pool in which to store and retrieve sessions. PSR-6 was chosen over the simpler PSR-16 as it specifically provides functionality around expiry , which allows us to expire sessions.","title":"Introduction"},{"location":"v1/intro/#usage","text":"Generally, you will only provide configuration for this service, including configuring a PSR-6 CacheItemPoolInterface service; mezzio-session will then consume it via its SessionMiddleware .","title":"Usage"},{"location":"v1/manual/","text":"Manual usage The following details the constructor of the Mezzio\\Session\\Cache\\CacheSessionPersistence class: /** * Prepare session cache and default HTTP caching headers. * * @param CacheItemPoolInterface $cache The cache pool instance * @param string $cookieName The name of the cookie * @param string $cacheLimiter The cache limiter setting is used to * determine how to send HTTP client-side caching headers. Those * headers will be added programmatically to the response along with * the session set-cookie header when the session data is persisted. * @param int $cacheExpire Number of seconds until the session cookie * should expire; defaults to 180 minutes (180m * 60s/m = 10800s), * which is the default of the PHP session.cache_expire setting. This * is also used to set the TTL for session data. * @param null|int $lastModified Timestamp when the application was last * modified. If not provided, this will look for each of * public/index.php, index.php, and finally the current working * directory, using the filemtime() of the first found. * @param bool $persistent Whether or not to create a persistent cookie. If * provided, this sets the Expires directive for the cookie based on * the value of $cacheExpire. Developers can also set the expiry at * runtime via the Session instance, using its persistSessionFor() * method; that value will be honored even if global persistence * is toggled true here. * @param string|null $cookieDomain The domain for the cookie. If not set, * the current domain is used. * @param bool $cookieSecure Whether or not the cookie should be required * to be set over an encrypted connection * @param bool $cookieHttpOnly Whether or not the cookie may be accessed * by client-side apis (e.g., Javascript). An http-only cookie cannot * be accessed by client-side apis. * @param string $cookieSameSite The same-site rule to apply to the persisted * cookie. Options include \"Lax\", \"Strict\", and \"None\". * Available since 1.4.0 * * @todo reorder these arguments so they make more sense and are in an * order of importance */ public function __construct( CacheItemPoolInterface $cache, string $cookieName, string $cookiePath = '/', string $cacheLimiter = 'nocache', int $cacheExpire = 10800, ?int $lastModified = null, bool $persistent = false, string $cookieDomain = null, bool $cookieSecure = false, bool $cookieHttpOnly = false, string $cookieSameSite = 'Lax' ) { Pass all required values and any optional values when creating an instance: use Cache\\Adapter\\Predis\\PredisCachePool; use Mezzio\\Session\\Cache\\CacheSessionPersistence; use Mezzio\\Session\\SessionMiddleware; $cachePool = new PredisCachePool('tcp://localhost:6379'); $persistence = new CacheSessionPersistence( $cachePool, 'MYSITE' '/', 'public', 60 * 60 * 24 * 30 // 30 days ); $middleware = new SessionMiddleware($persistence);","title":"Manual Usage"},{"location":"v1/manual/#manual-usage","text":"The following details the constructor of the Mezzio\\Session\\Cache\\CacheSessionPersistence class: /** * Prepare session cache and default HTTP caching headers. * * @param CacheItemPoolInterface $cache The cache pool instance * @param string $cookieName The name of the cookie * @param string $cacheLimiter The cache limiter setting is used to * determine how to send HTTP client-side caching headers. Those * headers will be added programmatically to the response along with * the session set-cookie header when the session data is persisted. * @param int $cacheExpire Number of seconds until the session cookie * should expire; defaults to 180 minutes (180m * 60s/m = 10800s), * which is the default of the PHP session.cache_expire setting. This * is also used to set the TTL for session data. * @param null|int $lastModified Timestamp when the application was last * modified. If not provided, this will look for each of * public/index.php, index.php, and finally the current working * directory, using the filemtime() of the first found. * @param bool $persistent Whether or not to create a persistent cookie. If * provided, this sets the Expires directive for the cookie based on * the value of $cacheExpire. Developers can also set the expiry at * runtime via the Session instance, using its persistSessionFor() * method; that value will be honored even if global persistence * is toggled true here. * @param string|null $cookieDomain The domain for the cookie. If not set, * the current domain is used. * @param bool $cookieSecure Whether or not the cookie should be required * to be set over an encrypted connection * @param bool $cookieHttpOnly Whether or not the cookie may be accessed * by client-side apis (e.g., Javascript). An http-only cookie cannot * be accessed by client-side apis. * @param string $cookieSameSite The same-site rule to apply to the persisted * cookie. Options include \"Lax\", \"Strict\", and \"None\". * Available since 1.4.0 * * @todo reorder these arguments so they make more sense and are in an * order of importance */ public function __construct( CacheItemPoolInterface $cache, string $cookieName, string $cookiePath = '/', string $cacheLimiter = 'nocache', int $cacheExpire = 10800, ?int $lastModified = null, bool $persistent = false, string $cookieDomain = null, bool $cookieSecure = false, bool $cookieHttpOnly = false, string $cookieSameSite = 'Lax' ) { Pass all required values and any optional values when creating an instance: use Cache\\Adapter\\Predis\\PredisCachePool; use Mezzio\\Session\\Cache\\CacheSessionPersistence; use Mezzio\\Session\\SessionMiddleware; $cachePool = new PredisCachePool('tcp://localhost:6379'); $persistence = new CacheSessionPersistence( $cachePool, 'MYSITE' '/', 'public', 60 * 60 * 24 * 30 // 30 days ); $middleware = new SessionMiddleware($persistence);","title":"Manual usage"}]} \ No newline at end of file +{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"mezzio-session-cache πŸ‡·πŸ‡Ί Русским Π³Ρ€Π°ΠΆΠ΄Π°Π½Π°ΠΌ ΠœΡ‹, участники Laminas, Ρ€ΠΎΠ΄ΠΈΠ»ΠΈΡΡŒ ΠΈ ΠΆΠΈΠ²Π΅ΠΌ Π² Ρ€Π°Π·Π½Ρ‹Ρ… странах. Π£ ΠΌΠ½ΠΎΠ³ΠΈΡ… ΠΈΠ· нас Π΅ΡΡ‚ΡŒ Π΄Ρ€ΡƒΠ·ΡŒΡ, родствСнники ΠΈ ΠΊΠΎΠ»Π»Π΅Π³ΠΈ ΠΊΠ°ΠΊ Π² России, Ρ‚Π°ΠΊ ΠΈ Π² Π£ΠΊΡ€Π°ΠΈΠ½Π΅. НСкоторыС ΠΈΠ· нас Ρ€ΠΎΠ΄ΠΈΠ»ΠΈΡΡŒ Π² России. НСкоторыС ΠΈΠ· нас ΠΆΠΈΠ²ΡƒΡ‚ Π² России. Π£ Π½Π΅ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Ρ… Π±Π°Π±ΡƒΡˆΠΊΠΈ ΠΈ Π΄Π΅Π΄ΡƒΡˆΠΊΠΈ ΡΡ€Π°ΠΆΠ°Π»ΠΈΡΡŒ с Ρ„Π°ΡˆΠΈΡΡ‚Π°ΠΌΠΈ Π²ΠΎ Π’Ρ‚ΠΎΡ€ΠΎΠΉ ΠΌΠΈΡ€ΠΎΠ²ΠΎΠΉ Π²ΠΎΠΉΠ½Π΅. Π—Π΄Π΅ΡΡŒ Π½ΠΈΠΊΡ‚ΠΎ Π½Π΅ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΈΠ²Π°Π΅Ρ‚ Ρ„Π°ΡˆΠΈΠ·ΠΌ. Π£ ΠΎΠ΄Π½ΠΎΠ³ΠΎ ΠΈΠ· нас Π΅ΡΡ‚ΡŒ украинская родствСнница, которая спаслась ΠΈΠ· Π΄ΠΎΠΌΠ° вмСстС с сыном. ПоСзд задСрТался ΠΈΠ·-Π·Π° Π±ΠΎΠΌΠ±Π΅ΠΆΠΊΠΈ Π½Π° Π΄ΠΎΡ€ΠΎΠ³Π΅ Π²ΠΏΠ΅Ρ€Π΅Π΄ΠΈ. Π£ нас Π΅ΡΡ‚ΡŒ Π΄Ρ€ΡƒΠ·ΡŒΡ, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ прячутся Π² Π±ΠΎΠΌΠ±ΠΎΡƒΠ±Π΅ΠΆΠΈΡ‰Π°Ρ…. ΠœΡ‹ с Ρ‚Ρ€Π΅Π²ΠΎΠ³ΠΎΠΉ ΠΆΠ΄Π΅ΠΌ вСсточки ΠΎΡ‚ Π½ΠΈΡ… послС Π²ΠΎΠ·Π΄ΡƒΡˆΠ½Ρ‹Ρ… Π½Π°Π»Π΅Ρ‚ΠΎΠ², ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ бСспорядочно наносят ΡƒΠ΄Π°Ρ€Ρ‹ ΠΈ ΠΏΠΎΠΏΠ°Π΄Π°ΡŽΡ‚ ΠΏΠΎ Π±ΠΎΠ»ΡŒΠ½ΠΈΡ†Π°ΠΌ, школам, дСтским садам ΠΈ Π΄ΠΎΠΌΠ°ΠΌ. ΠœΡ‹ Π½Π΅ Π±Π΅Ρ€Π΅ΠΌ это ΠΈΠ· ΠΊΠ°ΠΊΠΈΡ…-Π»ΠΈΠ±ΠΎ БМИ. ΠœΡ‹ наблюдаСм это Π½Π°ΠΏΡ€ΡΠΌΡƒΡŽ. Π’Ρ‹ довСряСтС Π½Π°ΠΌ достаточно, Ρ‡Ρ‚ΠΎΠ± ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ наши ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹, ΠΈ ΠΌΡ‹ просим вас Π΄ΠΎΠ²Π΅Ρ€ΠΈΡ‚ΡŒΡΡ Π½Π°ΠΌ вновь. ΠœΡ‹ нуТдаСмся Π² ΠΏΠΎΠΌΠΎΡ‰ΠΈ. Π’Ρ‹Ρ…ΠΎΠ΄ΠΈΡ‚Π΅ ΠΈ протСстуйтС ΠΏΡ€ΠΎΡ‚ΠΈΠ² этой бСсполСзной Π²ΠΎΠΉΠ½Ρ‹. ΠžΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚Π΅ ΠΊΡ€ΠΎΠ²ΠΎΠΏΡ€ΠΎΠ»ΠΈΡ‚ΠΈΠ΅. Π‘ΠΊΠ°ΠΆΠΈΡ‚Π΅ \"НСт Π²ΠΎΠΉΠ½Π΅!\" πŸ‡ΊπŸ‡Έ To Citizens of Russia We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism. One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences. You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say \"stop the war!\" This library provides a PSR-6 session persistence adapter for mezzio-session . Installation Run the following to install this library: $ composer require mezzio/mezzio-session-cache Documentation Browse the documentation online at https://docs.mezzio.dev/mezzio-session-cache/ Support Issues Chat Forum","title":"Home"},{"location":"#mezzio-session-cache","text":"","title":"mezzio-session-cache"},{"location":"#_1","text":"ΠœΡ‹, участники Laminas, Ρ€ΠΎΠ΄ΠΈΠ»ΠΈΡΡŒ ΠΈ ΠΆΠΈΠ²Π΅ΠΌ Π² Ρ€Π°Π·Π½Ρ‹Ρ… странах. Π£ ΠΌΠ½ΠΎΠ³ΠΈΡ… ΠΈΠ· нас Π΅ΡΡ‚ΡŒ Π΄Ρ€ΡƒΠ·ΡŒΡ, родствСнники ΠΈ ΠΊΠΎΠ»Π»Π΅Π³ΠΈ ΠΊΠ°ΠΊ Π² России, Ρ‚Π°ΠΊ ΠΈ Π² Π£ΠΊΡ€Π°ΠΈΠ½Π΅. НСкоторыС ΠΈΠ· нас Ρ€ΠΎΠ΄ΠΈΠ»ΠΈΡΡŒ Π² России. НСкоторыС ΠΈΠ· нас ΠΆΠΈΠ²ΡƒΡ‚ Π² России. Π£ Π½Π΅ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Ρ… Π±Π°Π±ΡƒΡˆΠΊΠΈ ΠΈ Π΄Π΅Π΄ΡƒΡˆΠΊΠΈ ΡΡ€Π°ΠΆΠ°Π»ΠΈΡΡŒ с Ρ„Π°ΡˆΠΈΡΡ‚Π°ΠΌΠΈ Π²ΠΎ Π’Ρ‚ΠΎΡ€ΠΎΠΉ ΠΌΠΈΡ€ΠΎΠ²ΠΎΠΉ Π²ΠΎΠΉΠ½Π΅. Π—Π΄Π΅ΡΡŒ Π½ΠΈΠΊΡ‚ΠΎ Π½Π΅ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΈΠ²Π°Π΅Ρ‚ Ρ„Π°ΡˆΠΈΠ·ΠΌ. Π£ ΠΎΠ΄Π½ΠΎΠ³ΠΎ ΠΈΠ· нас Π΅ΡΡ‚ΡŒ украинская родствСнница, которая спаслась ΠΈΠ· Π΄ΠΎΠΌΠ° вмСстС с сыном. ПоСзд задСрТался ΠΈΠ·-Π·Π° Π±ΠΎΠΌΠ±Π΅ΠΆΠΊΠΈ Π½Π° Π΄ΠΎΡ€ΠΎΠ³Π΅ Π²ΠΏΠ΅Ρ€Π΅Π΄ΠΈ. Π£ нас Π΅ΡΡ‚ΡŒ Π΄Ρ€ΡƒΠ·ΡŒΡ, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ прячутся Π² Π±ΠΎΠΌΠ±ΠΎΡƒΠ±Π΅ΠΆΠΈΡ‰Π°Ρ…. ΠœΡ‹ с Ρ‚Ρ€Π΅Π²ΠΎΠ³ΠΎΠΉ ΠΆΠ΄Π΅ΠΌ вСсточки ΠΎΡ‚ Π½ΠΈΡ… послС Π²ΠΎΠ·Π΄ΡƒΡˆΠ½Ρ‹Ρ… Π½Π°Π»Π΅Ρ‚ΠΎΠ², ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ бСспорядочно наносят ΡƒΠ΄Π°Ρ€Ρ‹ ΠΈ ΠΏΠΎΠΏΠ°Π΄Π°ΡŽΡ‚ ΠΏΠΎ Π±ΠΎΠ»ΡŒΠ½ΠΈΡ†Π°ΠΌ, школам, дСтским садам ΠΈ Π΄ΠΎΠΌΠ°ΠΌ. ΠœΡ‹ Π½Π΅ Π±Π΅Ρ€Π΅ΠΌ это ΠΈΠ· ΠΊΠ°ΠΊΠΈΡ…-Π»ΠΈΠ±ΠΎ БМИ. ΠœΡ‹ наблюдаСм это Π½Π°ΠΏΡ€ΡΠΌΡƒΡŽ. Π’Ρ‹ довСряСтС Π½Π°ΠΌ достаточно, Ρ‡Ρ‚ΠΎΠ± ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ наши ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹, ΠΈ ΠΌΡ‹ просим вас Π΄ΠΎΠ²Π΅Ρ€ΠΈΡ‚ΡŒΡΡ Π½Π°ΠΌ вновь. ΠœΡ‹ нуТдаСмся Π² ΠΏΠΎΠΌΠΎΡ‰ΠΈ. Π’Ρ‹Ρ…ΠΎΠ΄ΠΈΡ‚Π΅ ΠΈ протСстуйтС ΠΏΡ€ΠΎΡ‚ΠΈΠ² этой бСсполСзной Π²ΠΎΠΉΠ½Ρ‹. ΠžΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚Π΅ ΠΊΡ€ΠΎΠ²ΠΎΠΏΡ€ΠΎΠ»ΠΈΡ‚ΠΈΠ΅. Π‘ΠΊΠ°ΠΆΠΈΡ‚Π΅ \"НСт Π²ΠΎΠΉΠ½Π΅!\"","title":"πŸ‡·πŸ‡Ί Русским Π³Ρ€Π°ΠΆΠ΄Π°Π½Π°ΠΌ"},{"location":"#to-citizens-of-russia","text":"We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism. One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences. You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say \"stop the war!\" This library provides a PSR-6 session persistence adapter for mezzio-session .","title":"πŸ‡ΊπŸ‡Έ To Citizens of Russia"},{"location":"#installation","text":"Run the following to install this library: $ composer require mezzio/mezzio-session-cache","title":"Installation"},{"location":"#documentation","text":"Browse the documentation online at https://docs.mezzio.dev/mezzio-session-cache/","title":"Documentation"},{"location":"#support","text":"Issues Chat Forum","title":"Support"},{"location":"v1/config/","text":"Configuration This package allows configuring the following items: The PSR-6 CacheItemPoolInterface service to use. The session cookie name. The session cookie domain. The session cookie path. The session cookie secure option. The session cookie httponly option. The session cookie SameSite attribute (since 1.4.0). The cache limiter (which controls how resources using sessions are cached by the browser). When the session expires. When the resource using a session was last modified. Whether or not to create a persistent session cookie (i.e., one that will not expire when the browser is closed). This document details how to configure each of these items. Config service This package looks for a service named config that returns an array or array-like value. Inside this value, it looks for a key named mezzio-session-cache , which is expected to be an associative array or object that acts like an associative array. return [ 'mezzio-session-cache' => [ // key/value pairs ], ]; CacheItemPoolInterface By default, the factory will look for a service named Psr\\Cache\\CacheItemPoolInterface . If found, that service will be used to seed the persistence adapter. You may also provide a cache_item_pool_service configuration value. If present, this service name will be queried instead. Using a global pool To use a global cache item pool, configure the PSR-6 CacheItemPoolInterface service in your dependency configuration: use Psr\\Cache\\CacheItemPoolInterface; return [ 'dependencies' => [ 'factories' => [ CacheItemPoolInterface::class => FactoryProvidingACachePool::class, ], ], ]; Using a named pool To use a specific cache item pool: use Psr\\Cache\\CacheItemPoolInterface; return [ 'dependencies' => [ 'factories' => [ 'MoreSpecificPool' => FactoryProvidingACachePool::class, ], ], 'mezzio-session-cache' => [ 'cache_item_pool_service' => 'MoreSpecificPool', ], ]; Non-Pool configuration As noted earlier, you may configure a number of other values to customize your persistence adapter. The following is example configuration, with inline comments detailing expected and default values. use Psr\\Cache\\CacheItemPoolInterface; return [ 'mezzio-session-cache' => [ // Detailed in the above section; allows using a different // cache item pool than the global one. 'cache_item_pool_service' => CacheItemPoolInterface::class, // The name of the session cookie. This name must comply with // the syntax outlined in https://tools.ietf.org/html/rfc6265.html 'cookie_name' => 'PHPSESSION', // The (sub)domain that the cookie is available to. Setting this // to a subdomain (such as 'www.example.com') will make the cookie // available to that subdomain and all other sub-domains of it // (i.e. w2.www.example.com). To make the cookie available to the // whole domain (including all subdomains of it), simply set the // value to the domain name ('example.com', in this case). // Leave this null to use browser default (current hostname). 'cookie_domain' => null, // The path prefix of the cookie domain to which it applies. 'cookie_path' => '/', // Indicates that the cookie should only be transmitted over a // secure HTTPS connection from the client. When set to TRUE, the // cookie will only be set if a secure connection exists. 'cookie_secure' => false, // When TRUE the cookie will be made accessible only through the // HTTP protocol. This means that the cookie won't be accessible // by scripting languages, such as JavaScript. 'cookie_http_only' => false, // Available since 1.4.0 // // Asserts that a cookie must not be sent with cross-origin requests, // providing some protection against cross-site request forgery attacks (CSRF). // // Allowed values: // - Strict: The browser sends the cookie only for same-site requests // (that is, requests originating from the same site that set the cookie). // If the request originated from a different URL than the current one, // no cookies with the SameSite=Strict attribute are sent. // - Lax: The cookie is withheld on cross-site subrequests, such as calls // to load images or frames, but is sent when a user navigates to the URL // from an external site, such as by following a link. // - None: The browser sends the cookie with both cross-site and same-site // requests. 'cookie_same_site' => 'Lax', // Governs the various cache control headers emitted when // a session cookie is provided to the client. Value may be one // of \"nocache\", \"public\", \"private\", or \"private_no_expire\"; // semantics are the same as outlined in // http://php.net/session_cache_limiter 'cache_limiter' => 'nocache', // When the cache and the cookie should expire, in seconds. Defaults // to 180 minutes. 'cache_expire' => 10800, // An integer value indicating when the resource to which the session // applies was last modified. If not provided, it uses the last // modified time of, in order, // - the public/index.php file of the current working directory // - the index.php file of the current working directory // - the current working directory 'last_modified' => null, // A boolean value indicating whether or not the session cookie // should persist. By default, this is disabled (false); passing // a boolean true value will enable the feature. When enabled, the // cookie will be generated with an Expires directive equal to the // the current time plus the cache_expire value as noted above. // // As of 1.2.0, developers may define the session TTL by calling the // session instance's `persistSessionFor(int $duration)` method. When // that method has been called, the engine will use that value even if // the below flag is toggled off. 'persistent' => false, ], ]; Using the service By default, this package define the service Mezzio\\Session\\Cache\\CacheSessionPersistence , assigning it to the factory Mezzio\\Session\\Cache\\CacheSessionPersistenceFactory . After you have installed the package, you will need to tell your application to use this service when using the SessionMiddleware . The SessionMiddleware looks for the service Mezzio\\Session\\SessionPersistenceInterface . You can tell your container to use the CacheSessionPersistence in two different ways. First, you can alias it: // in config/autoload/dependencies.global.php: use Mezzio\\Session\\Cache\\CacheSessionPersistence; use Mezzio\\Session\\SessionPersistenceInterface; return [ 'dependencies' => [ 'aliases' => [ SessionPersistenceInterface::class => CacheSessionPersistence::class, ], ], ]; Second, you can instead assign the SessionPersistenceInterface service to the factory for the CacheSessionPersistence implementation: // in config/autoload/dependencies.global.php: use Mezzio\\Session\\Cache\\CacheSessionPersistenceFactory; use Mezzio\\Session\\SessionPersistenceInterface; return [ 'dependencies' => [ 'factories' => [ SessionPersistenceInterface::class => CacheSessionPersistenceFactory::class, ], ], ];","title":"Configuration"},{"location":"v1/config/#configuration","text":"This package allows configuring the following items: The PSR-6 CacheItemPoolInterface service to use. The session cookie name. The session cookie domain. The session cookie path. The session cookie secure option. The session cookie httponly option. The session cookie SameSite attribute (since 1.4.0). The cache limiter (which controls how resources using sessions are cached by the browser). When the session expires. When the resource using a session was last modified. Whether or not to create a persistent session cookie (i.e., one that will not expire when the browser is closed). This document details how to configure each of these items.","title":"Configuration"},{"location":"v1/config/#config-service","text":"This package looks for a service named config that returns an array or array-like value. Inside this value, it looks for a key named mezzio-session-cache , which is expected to be an associative array or object that acts like an associative array. return [ 'mezzio-session-cache' => [ // key/value pairs ], ];","title":"Config service"},{"location":"v1/config/#cacheitempoolinterface","text":"By default, the factory will look for a service named Psr\\Cache\\CacheItemPoolInterface . If found, that service will be used to seed the persistence adapter. You may also provide a cache_item_pool_service configuration value. If present, this service name will be queried instead.","title":"CacheItemPoolInterface"},{"location":"v1/config/#non-pool-configuration","text":"As noted earlier, you may configure a number of other values to customize your persistence adapter. The following is example configuration, with inline comments detailing expected and default values. use Psr\\Cache\\CacheItemPoolInterface; return [ 'mezzio-session-cache' => [ // Detailed in the above section; allows using a different // cache item pool than the global one. 'cache_item_pool_service' => CacheItemPoolInterface::class, // The name of the session cookie. This name must comply with // the syntax outlined in https://tools.ietf.org/html/rfc6265.html 'cookie_name' => 'PHPSESSION', // The (sub)domain that the cookie is available to. Setting this // to a subdomain (such as 'www.example.com') will make the cookie // available to that subdomain and all other sub-domains of it // (i.e. w2.www.example.com). To make the cookie available to the // whole domain (including all subdomains of it), simply set the // value to the domain name ('example.com', in this case). // Leave this null to use browser default (current hostname). 'cookie_domain' => null, // The path prefix of the cookie domain to which it applies. 'cookie_path' => '/', // Indicates that the cookie should only be transmitted over a // secure HTTPS connection from the client. When set to TRUE, the // cookie will only be set if a secure connection exists. 'cookie_secure' => false, // When TRUE the cookie will be made accessible only through the // HTTP protocol. This means that the cookie won't be accessible // by scripting languages, such as JavaScript. 'cookie_http_only' => false, // Available since 1.4.0 // // Asserts that a cookie must not be sent with cross-origin requests, // providing some protection against cross-site request forgery attacks (CSRF). // // Allowed values: // - Strict: The browser sends the cookie only for same-site requests // (that is, requests originating from the same site that set the cookie). // If the request originated from a different URL than the current one, // no cookies with the SameSite=Strict attribute are sent. // - Lax: The cookie is withheld on cross-site subrequests, such as calls // to load images or frames, but is sent when a user navigates to the URL // from an external site, such as by following a link. // - None: The browser sends the cookie with both cross-site and same-site // requests. 'cookie_same_site' => 'Lax', // Governs the various cache control headers emitted when // a session cookie is provided to the client. Value may be one // of \"nocache\", \"public\", \"private\", or \"private_no_expire\"; // semantics are the same as outlined in // http://php.net/session_cache_limiter 'cache_limiter' => 'nocache', // When the cache and the cookie should expire, in seconds. Defaults // to 180 minutes. 'cache_expire' => 10800, // An integer value indicating when the resource to which the session // applies was last modified. If not provided, it uses the last // modified time of, in order, // - the public/index.php file of the current working directory // - the index.php file of the current working directory // - the current working directory 'last_modified' => null, // A boolean value indicating whether or not the session cookie // should persist. By default, this is disabled (false); passing // a boolean true value will enable the feature. When enabled, the // cookie will be generated with an Expires directive equal to the // the current time plus the cache_expire value as noted above. // // As of 1.2.0, developers may define the session TTL by calling the // session instance's `persistSessionFor(int $duration)` method. When // that method has been called, the engine will use that value even if // the below flag is toggled off. 'persistent' => false, ], ];","title":"Non-Pool configuration"},{"location":"v1/config/#using-the-service","text":"By default, this package define the service Mezzio\\Session\\Cache\\CacheSessionPersistence , assigning it to the factory Mezzio\\Session\\Cache\\CacheSessionPersistenceFactory . After you have installed the package, you will need to tell your application to use this service when using the SessionMiddleware . The SessionMiddleware looks for the service Mezzio\\Session\\SessionPersistenceInterface . You can tell your container to use the CacheSessionPersistence in two different ways. First, you can alias it: // in config/autoload/dependencies.global.php: use Mezzio\\Session\\Cache\\CacheSessionPersistence; use Mezzio\\Session\\SessionPersistenceInterface; return [ 'dependencies' => [ 'aliases' => [ SessionPersistenceInterface::class => CacheSessionPersistence::class, ], ], ]; Second, you can instead assign the SessionPersistenceInterface service to the factory for the CacheSessionPersistence implementation: // in config/autoload/dependencies.global.php: use Mezzio\\Session\\Cache\\CacheSessionPersistenceFactory; use Mezzio\\Session\\SessionPersistenceInterface; return [ 'dependencies' => [ 'factories' => [ SessionPersistenceInterface::class => CacheSessionPersistenceFactory::class, ], ], ];","title":"Using the service"},{"location":"v1/installation/","text":"Cache Implementation Required To use this component, a PSR-6 CacheItemPoolInterface implementation is required. laminas-cache provides the PSR-6 implementations, install it and choose one of the cache adapters. Install laminas-cache and a Cache Adapter Install laminas-cache via Composer : $ composer require laminas/laminas-cache laminas-cache is shipped without a specific cache adapter to allow free choice of storage backends and their dependencies. For example, install the laminas-cache Filesystem adapter : $ composer require laminas/laminas-cache-storage-adapter-filesystem Read More in the laminas-cache Documentation PSR-6 Cache Adapters","title":"Installation"},{"location":"v1/installation/#cache-implementation-required","text":"To use this component, a PSR-6 CacheItemPoolInterface implementation is required. laminas-cache provides the PSR-6 implementations, install it and choose one of the cache adapters.","title":"Cache Implementation Required"},{"location":"v1/intro/","text":"Introduction This component provides a PSR-6 session persistence adapter for use with mezzio-session . PSR-6 defines cache items and cache item pools. This package uses a cache item pool in which to store and retrieve sessions. PSR-6 was chosen over the simpler PSR-16 as it specifically provides functionality around expiry , which allows us to expire sessions. Usage Generally, you will only provide configuration for this service, including configuring a PSR-6 CacheItemPoolInterface service; mezzio-session will then consume it via its SessionMiddleware .","title":"Introduction"},{"location":"v1/intro/#introduction","text":"This component provides a PSR-6 session persistence adapter for use with mezzio-session . PSR-6 defines cache items and cache item pools. This package uses a cache item pool in which to store and retrieve sessions. PSR-6 was chosen over the simpler PSR-16 as it specifically provides functionality around expiry , which allows us to expire sessions.","title":"Introduction"},{"location":"v1/intro/#usage","text":"Generally, you will only provide configuration for this service, including configuring a PSR-6 CacheItemPoolInterface service; mezzio-session will then consume it via its SessionMiddleware .","title":"Usage"},{"location":"v1/manual/","text":"Manual usage The following details the constructor of the Mezzio\\Session\\Cache\\CacheSessionPersistence class: /** * Prepare session cache and default HTTP caching headers. * * @param CacheItemPoolInterface $cache The cache pool instance * @param string $cookieName The name of the cookie * @param string $cacheLimiter The cache limiter setting is used to * determine how to send HTTP client-side caching headers. Those * headers will be added programmatically to the response along with * the session set-cookie header when the session data is persisted. * @param int $cacheExpire Number of seconds until the session cookie * should expire; defaults to 180 minutes (180m * 60s/m = 10800s), * which is the default of the PHP session.cache_expire setting. This * is also used to set the TTL for session data. * @param null|int $lastModified Timestamp when the application was last * modified. If not provided, this will look for each of * public/index.php, index.php, and finally the current working * directory, using the filemtime() of the first found. * @param bool $persistent Whether or not to create a persistent cookie. If * provided, this sets the Expires directive for the cookie based on * the value of $cacheExpire. Developers can also set the expiry at * runtime via the Session instance, using its persistSessionFor() * method; that value will be honored even if global persistence * is toggled true here. * @param string|null $cookieDomain The domain for the cookie. If not set, * the current domain is used. * @param bool $cookieSecure Whether or not the cookie should be required * to be set over an encrypted connection * @param bool $cookieHttpOnly Whether or not the cookie may be accessed * by client-side apis (e.g., Javascript). An http-only cookie cannot * be accessed by client-side apis. * @param string $cookieSameSite The same-site rule to apply to the persisted * cookie. Options include \"Lax\", \"Strict\", and \"None\". * Available since 1.4.0 * @param bool $autoRegenerate Whether or not the session ID should be * regenerated on session data changes * Available since 1.13.0 * * @todo reorder these arguments so they make more sense and are in an * order of importance */ public function __construct( CacheItemPoolInterface $cache, string $cookieName, string $cookiePath = '/', string $cacheLimiter = 'nocache', int $cacheExpire = 10800, ?int $lastModified = null, bool $persistent = false, string $cookieDomain = null, bool $cookieSecure = false, bool $cookieHttpOnly = false, string $cookieSameSite = 'Lax', bool $autoRegenerate = true, ) { Pass all required values and any optional values when creating an instance: use Cache\\Adapter\\Predis\\PredisCachePool; use Mezzio\\Session\\Cache\\CacheSessionPersistence; use Mezzio\\Session\\SessionMiddleware; $cachePool = new PredisCachePool('tcp://localhost:6379'); $persistence = new CacheSessionPersistence( $cachePool, 'MYSITE' '/', 'public', 60 * 60 * 24 * 30 // 30 days ); $middleware = new SessionMiddleware($persistence);","title":"Manual Usage"},{"location":"v1/manual/#manual-usage","text":"The following details the constructor of the Mezzio\\Session\\Cache\\CacheSessionPersistence class: /** * Prepare session cache and default HTTP caching headers. * * @param CacheItemPoolInterface $cache The cache pool instance * @param string $cookieName The name of the cookie * @param string $cacheLimiter The cache limiter setting is used to * determine how to send HTTP client-side caching headers. Those * headers will be added programmatically to the response along with * the session set-cookie header when the session data is persisted. * @param int $cacheExpire Number of seconds until the session cookie * should expire; defaults to 180 minutes (180m * 60s/m = 10800s), * which is the default of the PHP session.cache_expire setting. This * is also used to set the TTL for session data. * @param null|int $lastModified Timestamp when the application was last * modified. If not provided, this will look for each of * public/index.php, index.php, and finally the current working * directory, using the filemtime() of the first found. * @param bool $persistent Whether or not to create a persistent cookie. If * provided, this sets the Expires directive for the cookie based on * the value of $cacheExpire. Developers can also set the expiry at * runtime via the Session instance, using its persistSessionFor() * method; that value will be honored even if global persistence * is toggled true here. * @param string|null $cookieDomain The domain for the cookie. If not set, * the current domain is used. * @param bool $cookieSecure Whether or not the cookie should be required * to be set over an encrypted connection * @param bool $cookieHttpOnly Whether or not the cookie may be accessed * by client-side apis (e.g., Javascript). An http-only cookie cannot * be accessed by client-side apis. * @param string $cookieSameSite The same-site rule to apply to the persisted * cookie. Options include \"Lax\", \"Strict\", and \"None\". * Available since 1.4.0 * @param bool $autoRegenerate Whether or not the session ID should be * regenerated on session data changes * Available since 1.13.0 * * @todo reorder these arguments so they make more sense and are in an * order of importance */ public function __construct( CacheItemPoolInterface $cache, string $cookieName, string $cookiePath = '/', string $cacheLimiter = 'nocache', int $cacheExpire = 10800, ?int $lastModified = null, bool $persistent = false, string $cookieDomain = null, bool $cookieSecure = false, bool $cookieHttpOnly = false, string $cookieSameSite = 'Lax', bool $autoRegenerate = true, ) { Pass all required values and any optional values when creating an instance: use Cache\\Adapter\\Predis\\PredisCachePool; use Mezzio\\Session\\Cache\\CacheSessionPersistence; use Mezzio\\Session\\SessionMiddleware; $cachePool = new PredisCachePool('tcp://localhost:6379'); $persistence = new CacheSessionPersistence( $cachePool, 'MYSITE' '/', 'public', 60 * 60 * 24 * 30 // 30 days ); $middleware = new SessionMiddleware($persistence);","title":"Manual usage"}]} \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml index 8e7019f..86a8b6b 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -2,27 +2,27 @@ https://docs.mezzio.dev/mezzio-session-cache/ - 2024-01-18 + 2024-05-07 daily https://docs.mezzio.dev/mezzio-session-cache/v1/config/ - 2024-01-18 + 2024-05-07 daily https://docs.mezzio.dev/mezzio-session-cache/v1/installation/ - 2024-01-18 + 2024-05-07 daily https://docs.mezzio.dev/mezzio-session-cache/v1/intro/ - 2024-01-18 + 2024-05-07 daily https://docs.mezzio.dev/mezzio-session-cache/v1/manual/ - 2024-01-18 + 2024-05-07 daily \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz index 83e82fbd0d443d47bafd0c39074dcbfdc4498f4d..71f323d67d8b2554581d954553dffc6e4a583064 100644 GIT binary patch literal 251 zcmVcX>O`1JAgHi+YQ@XcT|x)fWoWt=oN>SSE(T5|gQps(a8 zH{zN-+S1f=#Fq4>T;2i3ab)O<4eEj{N(BMalO;i63CYME-@Q=2r~FVW&umfCy^5VZXZt0Ma{foa zBAM0T*X_@i!xnUkXVChL;ZdUS(|SLOfT_i@yZD(?~l^HJCX003dd Bfeiov literal 250 zcmV0W-IIgZ z@N05ta#hL!Thixz{stJwk)h4T%QLc=IzZKz3&J~untc(msme@%d3z0aQHhCy1*4-v z=FQ__BhzMpd8KG@lA=l$DsY&dEC~{`k6LW&?T*$BZT6+|&K5P*%g~uqG8dtxb$1Sn zWLATZ+n+6m22>0u+pWjf2F%hqnM=AR>zv|xbiE8$>HgpMb(D`Po`?3&+1LXB02|GE A+W-In diff --git a/v1/manual/index.html b/v1/manual/index.html index 0295ad0..55c0f0a 100644 --- a/v1/manual/index.html +++ b/v1/manual/index.html @@ -314,7 +314,10 @@

Manual usage

* @param string $cookieSameSite The same-site rule to apply to the persisted * cookie. Options include "Lax", "Strict", and "None". * Available since 1.4.0 - * + * @param bool $autoRegenerate Whether or not the session ID should be + * regenerated on session data changes + * Available since 1.13.0 + * * @todo reorder these arguments so they make more sense and are in an * order of importance */ @@ -329,7 +332,8 @@

Manual usage

string $cookieDomain = null, bool $cookieSecure = false, bool $cookieHttpOnly = false, - string $cookieSameSite = 'Lax' + string $cookieSameSite = 'Lax', + bool $autoRegenerate = true, ) {

Pass all required values and any optional values when creating an instance:

use Cache\Adapter\Predis\PredisCachePool;