Commit 3ba5c00e authored by Jason Lewis's avatar Jason Lewis

Merge pull request #881 from TommyC81/develop

Slightly re-organized and added some Session usage documentation
parents 603e349d 110078d2
......@@ -5,6 +5,7 @@
- [Storing Items](#put)
- [Retrieving Items](#get)
- [Removing Items](#forget)
- [Flashing Items](#flash)
- [Regeneration](#regeneration)
<a name="put"></a>
......@@ -16,10 +17,6 @@ To store items in the session call the put method on the Session class:
The first parameter is the **key** to the session item. You will use this key to retrieve the item from the session. The second parameter is the **value** of the item.
The **flash** method stores an item in the session that will expire after the next request. It's useful for storing temporary data like status or error messages:
Session::flash('status', 'Welcome Back!');
<a name="get"></a>
## Retrieving Items
......@@ -53,6 +50,27 @@ You can even remove all of the items from the session using the **flush** method
Session::flush();
<a name="flash"></a>
## Flashing Items
The **flash** method stores an item in the session that will expire after the next request. It's useful for storing temporary data like status or error messages:
Session::flash('status', 'Welcome Back!');
Flash items that are expiring in subsequent requests can be retained for another request by using one of the **reflash** or **keep** methods:
Retain all items for another request:
Session::reflash();
Retain an individual item for another request:
Session::keep('status');
Retain several items for another request:
Session::keep(array('status', 'other_item'));
<a name="regeneration"></a>
## Regeneration
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment