title: Why doesn't the login session "stick" when login in using "ionic serve" window but works when I point the browser to the www folder?
body: <p>I am using Ionic to build a login system on top of Codeigniter/Ion_Auth/codeigniter-restclient and when I try to login from "ionic server" the login works but the next api request to the logged_in() method returns false.</p>
  
  <p>The same thing works properly when I point the browser to the www folder. </p>
  
  <p>So here is the problem step by step:</p>
  
  <ol>
  <li><p>run ionic serve</p></li>
  <li><p>you see the login form (<a href="http://localhost:8100/#/app/login">http://localhost:8100/#/app/login</a>)</p></li>
  <li><p>enter email and pass</p></li>
  <li><p>the rest api returns "login successful"</p></li>
  <li><p>$state.go('app.profile') works and redirects to <a href="http://localhost:8100/#/app/profile">http://localhost:8100/#/app/profile</a></p></li>
  <li><p>REST get api/logged_in returns false and I redirect to the login page</p></li>
  </ol>
  
  <p>If I do the same in a regular browser, step 1 becomes: open browser and go to <a href="http://localhost:8888/App/www/#/app/login">http://localhost:8888/App/www/#/app/login</a>, at step 6 REST get api/logged_in returns true and I don't get redirected to the login page, I stay on the profile page.</p>
  
  <p>The code is the same. So my guess is that maybe ion_auth doesn't get the cookies it wants or the session is reseted. I am not sure at this point what the problem is. This is my first Ionic/App project so I might be missing something about the proper way to authenticate from a mobile app using code that works in browsers</p>
  
  <p>Thank you</p>
  
  <p>UPDATE:
  It seems that when using the 'ionic server' window every request to the API triggers a new session. The new session is stored in the database and ion_auth tests the logged_in against that last one, which doesn't contain the login details.</p>