Skip to content

Commit

Permalink
Document session helper.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Feb 24, 2015
1 parent 80a81ec commit 06b7527
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions session.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@ The Laravel framework uses the `flash` session key internally, so you should not
<a name="session-usage"></a>
## Session Usage

The session may be accessed in several ways, via the HTTP request's `session` method, the `Session` facade, or the `session` helper function. When the `session` helper is called without arguments, it will return the entire session object. For example:

session()->regenerate();

#### Storing An Item In The Session

Session::put('key', 'value');

session(['key' => 'value']);

#### Push A Value Onto An Array Session Value

Session::push('user.teams', 'developers');
Expand All @@ -36,6 +42,8 @@ The Laravel framework uses the `flash` session key internally, so you should not

$value = Session::get('key');

$value = session('key');

#### Retrieving An Item Or Returning A Default Value

$value = Session::get('key', 'default');
Expand Down

0 comments on commit 06b7527

Please sign in to comment.