You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library requires PHP 8.1 or later. It has been tested on PHP 8.1-8.5. We recommend using the latest available version of PHP as a matter of principle. It has no userland dependencies.
10
+
This library requires PHP 8.1 or later. It has been tested on PHP 8.1-8.5. We recommend using the latest available version of PHP as a matter of principle. Its only dependency is [aura/session-interface](https://packagist.org/packages/aura/session-interface), which provides the shared session and segment contracts.
11
11
12
12
It is installable and autoloadable via Composer as [aura/session](https://packagist.org/packages/aura/session).
Copy file name to clipboardExpand all lines: docs/getting-started.md
+48Lines changed: 48 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,15 @@ The benefit of a session segment is that we can deconflict the keys in the
56
56
the segment names. With segments, different packages can use the `$_SESSION`
57
57
superglobal without stepping on each other's toes.
58
58
59
+
To remove a single value from a _Segment_, use the `remove()` method with the key. Calling `remove()` with no argument (or `null`) removes the entire segment from `$_SESSION`.
60
+
61
+
```php
62
+
<?php
63
+
$segment->remove('foo'); // unset just the 'foo' key
64
+
$segment->remove(); // unset the whole segment
65
+
?>
66
+
```
67
+
59
68
To clear all the values on a _Segment_, use the `clear()` method.
0 commit comments