title: Cassandra manual pagination: exposing pageState to client (in nodeJS)
body: <p>Is it safe to expose the pageState to a client? Is it linked to the original query,or can I potentially expose other data? In my current implementation the client can send anything as a pageState.</p>
  
  <p>Long story:
  I'm building a REST api on NodeJs and I get my data from a Cassandra cluster. Since the queries have pretty big results, I need to do some kind of pagination. I got manual pagination working, but in my current implementation I send the pageState to the client and it sends it back in order to get the next batch of results.</p>
  
  <pre><code>if(req.query.page) {
          options.pageState = new Buffer(req.query.page,'hex');   
  };
  client.eachRow(query, [], options, function (n, row) {
         arr.push(row);
         }, function (err, result) { 
               res.send({
                  values: arr,
                  next: result.pageState
               });
          });
  </code></pre>
  
  <p>The other idea would be to save it in some kind of cache, and send an id to the client. I would send that id between server and client, and the pageState couldn't be modified. Just wondering if that's overhead, or actually needed. Thanks.</p>