title: Error with node-redis: Deprecated: The SET command contains a argument of type Object
body: <p>I'm using the <code>connect-redis-crypto</code> module (<a href="https://github.com/jas-/connect-redis-crypto" rel="noreferrer">https://github.com/jas-/connect-redis-crypto</a>
  ) which is built for encrypting redis session data on top of <code>connect-redis</code>(<a href="https://github.com/tj/connect-redis" rel="noreferrer">https://github.com/tj/connect-redis</a>). My redis version is <code>3.2.8</code>.</p>
  
  <p>I am running into error <code>node-redis: Deprecated: The SET command contains a argument of type Object</code>. Based on the larger error message, it seems to come from trying to parse the string <code>[object Object]</code> when it is not a JSON string. I put nested objects that hold user information on <code>req.session</code> which directly gets stored (and ideally encrypted) in redis.</p>
  
  <p>From some sources I learned nested objects in Redis are not allowed which might cause this error, but I believe this library stores data as JSON to allow for nested objects. <code>connect-redis</code> works fine for me, but when this <code>connect-redis-crypto</code> library tries to JSON parse encrypted data it throws me this particular error.</p>
  
  <p>Would really appreciate your help!</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>node_redis: Deprecated: The SET command contains a argument of type Object.
  This is converted to "[object Object]" by using .toString() now and will return an error from v.3.0 on.
  Please handle this in your code to make sure everything works as you intended it to.
  8 May 18:24:48 - ---NEW REQUEST---
  REQUEST : GET /api/somePath/client
  QUERY   : {}
  BODY    : {}
  data [object Object]
  err SyntaxError: Unexpected token o in JSON at position 1
      at JSON.parse (&lt;anonymous&gt;)
      at Command.callback (/Users/Documents/web-AOT/server/node_modules/connect-redis-crypto/lib/connect-redis.js:262:35)
      at normal_reply (/Users/Documents/web-AOT/server/node_modules/redis/index.js:721:21)
      at RedisClient.return_reply (/Users/Documents/web-AOT/server/node_modules/redis/index.js:819:9)
      at JavascriptRedisParser.returnReply (/Users/Documents/web-AOT/server/node_modules/redis/index.js:192:18)
      at JavascriptRedisParser.execute (/Users/Documents/web-AOT/server/node_modules/redis-parser/lib/parser.js:560:12)
      at Socket.&lt;anonymous&gt; (/Users/Documents/web-AOT/server/node_modules/redis/index.js:274:27)
      at emitOne (events.js:96:13)
      at Socket.emit (events.js:189:7)
      at readableAddChunk (_stream_readable.js:176:18)
      at Socket.Readable.push (_stream_readable.js:134:10)
      at TCP.onread (net.js:551:20)</code></pre>
  </div>
  </div>
  </p>