title: PHP session lost after redirect
body: <p>How do I resolve the problem of losing a session after a redirect in PHP?</p>
  
  <p>Recently, I encountered a very common problem of losing session after redirect. And after searching through this website I can still find no solution (although <a href="https://stackoverflow.com/questions/2037316/php-session-destroyed-lost-after-header">this</a> came the closest). </p>
  
  <p><strong>Update</strong></p>
  
  <p>I have found the answer and I thought I'd post it here to help anyone experiencing the same problem.</p>