如果用户的PHP会话离开网站并返回后会持续存在吗?

I'm creating a session variable in one PHP page and on that page I am redirecting to an online payment portal.

After payment, the user is redirected to a payment success page on my server. Will the session variable still be valid?

The above answers are true if you are storing sessions using cookies. If cookies are disabled then a PHP_SESSION parameter will be passed in the URL. For the returning user to be able to continue using the session the payment gateway would need to redirect back with the same session hash.

As stated if you are using the default PHP session settings then cookies should be in use and this would not be an issue. What about the users whom may have cookies disabled, your flow will break. Chances are slim and the amount of users effected may be small.