title: Is it possible to transmit PHP session id via ajax and store it with jquery cookie?
body: <p>First of all, i'm asking this before i make all of the code changes necessary to implement this in my website. 99% of data in my application is generated via ajax, and transmitted as json back to javascript which is responsible for generating all html content. this works similar to Angular.js but with a php backend. the only thing <code>index.php</code> does is start the session, and some other session related tasks, like distinguishing a guest and a logged in user and updating the last time seen for the guest/user's ip address.</p>
  
  <p>Here's what i want to do:</p>
  
  <ol>
  <li>get session id after creating it using <code>session_id()</code> to get the session's id.</li>
  <li>add it to a an array and json encode it.</li>
  <li>decode the json with javascript and manually create/update the session id cookie with jQuery cookie plugin.</li>
  </ol>
  
  <p>My question is if store the php session id in this matter, will php still treat the session as valid when making requests to my ajax api? I'm attempting to build an application that with a static html/js frontend that interacts entirely through this ajax api. the goal is to offer similar charachteristics and performance of what you get with Angular.js. Is this possible, and if so is this advisable? </p>