Permalink
Browse files

Style tweaks

  • Loading branch information...
1 parent 27c3739 commit 78e164b545132f9175ae318ca14c2549ec49df98 @mjackson committed Dec 22, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/session-cookie.js
@@ -63,9 +63,9 @@ function sessionCookieReader(options) {
if (cookie) {
cookie = new Buffer(cookie, 'base64').toString('utf8');
- var splitPoint = cookie.lastIndexOf('--'),
- data = cookie.substring(0, splitPoint),
- digest = cookie.substring(splitPoint + 2);
+ var index = cookie.lastIndexOf('--');
+ var data = cookie.substring(0, index);
+ var digest = cookie.substring(index + 2);
if (digest === sessionDigest(data, options.secret)) {
try {
@@ -93,7 +93,6 @@ function sessionCookieWriter(options) {
if (session) {
var data = JSON.stringify(session);
var digest = sessionDigest(data, options.secret);
-
var cookie = new Buffer(data + '--' + digest, 'utf8').toString('base64');
if (cookie.length > 4096) {

0 comments on commit 78e164b

Please sign in to comment.