简体   繁体   中英

PHP session is automatically gets destroyed after payu payment gateway redirect

I am working on an e-commerce test website.

  1. in my checkout page session is on works fine.

  2. after checkout, redirecting to payu money gateway website for payment

  3. after payment it is redirecting to my e-commerce website. Now my session gets destroyed.

It shouldn't destroy until unless the user logs out from the website. It is not my code problem, because it is redirecting to my website from payu website. but the session is automatic gets destroyed

before starting your session:

maybe try this:

 // 1 week = 604800 seconds
 // server should keep session data for exactly (or at least) 1 week
 ini_set('session.gc_maxlifetime', 604800);

 // each client should remember their session id for EXACTLY 1 week
 session_set_cookie_params(604800);

 session_start(); // start the session

I have a solution after implementing on the ecommerce i can say it actually happens- 1.just store the information like transation_id,user_id and status. 2.On the behlaf of the responce it will return transation_id so we can easily handle by transation_id and status.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM