Skip to content

Commit 45c3b0d

Browse files
committed
Deprecate support for deprecated PHP session options
1 parent 57887d3 commit 45c3b0d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"ratchet/rfc6455": "^0.3.1",
1616
"react/event-loop": "^1.3",
1717
"react/socket": "^1.11",
18+
"symfony/deprecation-contracts": "^2.5 || ^3.0",
1819
"symfony/http-foundation": "^6.4 || ^7.1",
1920
"symfony/routing": "^6.4 || ^7.1"
2021
},

src/Session/Storage/ReadOnlyNativeSessionStorage.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function isStarted(): bool
187187
*
188188
* @see NativeSessionStorage::setOptions()
189189
*
190-
* @note The options list is based on the supported options as of Symfony 6.1.0
190+
* @note The options list is based on the supported options as of Symfony 7.2.0
191191
*/
192192
public function setOptions(array $options): void
193193
{
@@ -202,6 +202,10 @@ public function setOptions(array $options): void
202202
]);
203203

204204
foreach ($options as $key => $value) {
205+
if (\in_array($key, ['referer_check', 'use_only_cookies', 'use_trans_sid', 'trans_sid_hosts', 'trans_sid_tags', 'sid_length', 'sid_bits_per_character'], true)) {
206+
trigger_deprecation('babdev/websocket-server', '0.1', 'The "%s" option for the read-only native session storage is deprecated as of PHP 8.4 and support will be removed before the 1.0 release.', $key);
207+
}
208+
205209
if (isset($validOptions[$key])) {
206210
if ('cookie_secure' === $key && 'auto' === $value) {
207211
continue;

0 commit comments

Comments
 (0)