# Session not maintaining for the first time

**URL:** <https://forum.kirupa.com/t/session-not-maintaining-for-the-first-time/326722>\
**Category:** programming\
**Created:** [January 7, 2012, 9:19am UTC](https://forum.kirupa.com/t/session-not-maintaining-for-the-first-time/326722 "2012-01-07T09:19:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rishibala143](https://avatars.discourse-cdn.com/v4/letter/r/c2a13f/32.png) [@rishibala143](https://forum.kirupa.com/u/rishibala143)\
**Post date:** [January 7, 2012, 9:19am UTC](https://forum.kirupa.com/t/session-not-maintaining-for-the-first-time/326722/1 "2012-01-07T09:19:34Z")

</div>

Hi

I am developing a e-commerce website. The user logs in and buy a product when he checkout the page will redirect to the payment gateway. After the payment is completed it will return back to my website. This is ok. But when it is returning back the session maintained in my website get lost. This happen only for the first time. If the user again logged in and checkout the process works good and the session is maintaining.

Why does the session lost for first time.

I used session\_start() in all the pages…

I cannot find the solutions. Kindly help…

Regards  
P.Balakrishnan
