title: Handling sessions between different ports
body: <p>Our problem is that we use one server that listens to port 80 and port 8080 where the ports map to the database and website, respectively. The reason for this separation is due to technical issues (it's not an option to merge these). The "database"-server can handle PHP, but not the latter.</p>
  
  <p>We're are trying to implement sessions using PHP-scripts. The database holding the users is an mySQL-database, and the sessions are for login-functionality of users. We use jQuery's Ajax-function to obtain the login-dialog-box which is coded on the database-server.</p>
  
  <p>If we test the login-dialog-box on the database-server, it's all good. We get the same session id each time. However, when we try use it on the website-server (after loading it with an Ajax-call) we receive a new session id for each request (i.e., each time we do something)! So we are unable to use sessions to keep track of things since we are unable to keep the session id linked to the "active session" (that didn't sound as good as I hoped).</p>
  
  <p>We are not certain of what happens here, but suspect that the database-server sees each request as "a new user". Makes sense?</p>
  
  <p>How can we solve this problem?</p>
  
  <p>In advance, thanks! :-)</p>
  
  <p><em>Sidenote:</em>
  Not sure it's relevant, but we've seen a lot of topics asking about it: Yes, we have started the session! :-)</p>