Skip to content

Commit

Permalink
mention that sessions are serialized with Mojo::JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 18, 2012
1 parent 417ceaf commit 05a2193
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

3.0 2012-06-17
3.0 2012-06-18
- Code name "Rainbow", this is a major release.
- Removed Mojolicious::Plugin::I18N so it can be maintained as a separate
distribution.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -889,8 +889,8 @@ timeout, which usually defaults to C<15> seconds.
$c = $c->session({foo => 'bar'});
$c = $c->session(foo => 'bar');
Persistent data storage, stored C<JSON> serialized in a signed cookie. Note
that cookies are generally limited to 4096 bytes of data.
Persistent data storage, stored serialized with L<Mojo::JSON> in a signed
cookie. Note that cookies are generally limited to 4096 bytes of data.
# Manipulate session
$c->session->{foo} = 'bar';
Expand Down
5 changes: 3 additions & 2 deletions lib/Mojolicious/Guides/Growing.pod
Expand Up @@ -373,8 +373,9 @@ method L<Mojolicious::Controller/"flash">.
$self->flash(message => 'Everything is fine.');
$self->redirect_to('goodbye');

Just remember that everything is stored in C<HMAC-SHA1> signed cookies, so
there is usually a 4096 byte limit, depending on the browser.
Just remember that everything is stored serialized with L<Mojo::JSON> in
C<HMAC-SHA1> signed cookies, so there is usually a 4096 byte limit, depending
on the browser.

=head2 Final prototype

Expand Down
2 changes: 2 additions & 0 deletions lib/Mojolicious/Lite.pm
Expand Up @@ -741,6 +741,8 @@ L<Mojolicious::Plugin::DefaultHelpers/"session">.
@@ counter.html.ep
Counter: <%= session 'counter' %>
Just be aware that all session data gets serialized with L<Mojo::JSON>.
=head2 Secret
Note that you should use a custom L<Mojolicious/"secret"> to make signed
Expand Down

0 comments on commit 05a2193

Please sign in to comment.