简体   繁体   English

PHP session 在 payu 支付网关重定向后自动销毁

[英]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.在我的结帐页面 session 上工作正常。

  2. after checkout, redirecting to payu money gateway website for payment结帐后,重定向到payu money gateway网站进行支付

  3. after payment it is redirecting to my e-commerce website.付款后,它会重定向到我的电子商务网站。 Now my session gets destroyed.现在我的 session 被销毁了。

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.这不是我的代码问题,因为它是从 payu 网站重定向到我的网站。 but the session is automatic gets destroyed但是 session 会自动被销毁

before starting your session:在启动您的 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.我在电子商务上实施后有一个解决方案,我可以说它确实发生了- 1.只需存储 transation_id、user_id 和状态等信息。 2.On the behlaf of the responce it will return transation_id so we can easily handle by transation_id and status. 2.代表responce它会返回transation_id所以我们可以很容易地通过transation_id和status来处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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