lib/utils.js
function(claims, callback){
			if(typeof claims === "function" && !callback){
				callback = claims;
				claims = {};
			}
			var self = this,
				sid = uuid.v4();
			var token = jwt.sign(_.extend({ jti: sid }, claims || {}), options.secret, { algorithm: options.algorithm });
			options.client.setex(options.keyspace + sid, options.maxAge, JSON.stringify(serializeSession(self)), function(error){
				self.id = sid;
				callback(error, token);
			});
		}
function(claims, callback){
			if(typeof claims === "function" && !callback){
				callback = claims;
				claims = {};
			}
			var self = this,
				sid = uuid.v4();
			var token = jwt.sign(_.extend({ jti: sid }, claims || {}), options.secret, { algorithm: options.algorithm });
			options.client.setex(options.keyspace + sid, options.maxAge, JSON.stringify(serializeSession(self)), function(error){
				self.id = sid;
				callback(error, token);
			});
		}
function ( claims , callback ) { if ( typeof claims === "function" && ! callback ) { callback = claims ; claims = { } ; } var self = this , sid = uuid . v4 ( ) ; var token = jwt . sign ( _ . extend ( { jti : sid } , claims || { } ) , options . secret , { algorithm : options . algorithm } ) ; options . client . setex ( options . keyspace + sid , options . maxAge , JSON . stringify ( serializeSession ( self ) ) , function ( error ) { self . id = sid ; callback ( error , token ) ; } ) ; }
create a new session and return the jwt
create a new session and return the jwt