Uncaught Exception: Serialization of 'Closure' is not allowed
Hope you all are doing well.
I am facing this issue in online payment methods when redirecting to third party gateway.
<b>Fatal error</b>: Uncaught Exception: Serialization of 'Closure' is not allowed in /app/vendor/magento/framework/Session/SessionManager.php:151
#0 /app/vendor/magento/framework/Session/SessionManager.php(151): session_write_close()
#1 [internal function]: Magento\Framework\Session\SessionManager->writeClose()
thrown in <b>/app/vendor/magento/framework/Session/SessionManager.php</b> on line <b>151</b><br />
I have debug this by creating logs and session values are maintained during redirection. Unable to find the root cause. I am using magento 2.3.