Redirect to index page after utils->redirect to new controller

Hello All,

while using shop redirect function (OxidEsales\EshopCommunity\Core\Utils->redirect) to other new controller it unset the session value and return to index.php. After checking in log file we are found that in error logs. if it related to the payment module or any other shop configuration.

OXID Logger.ERROR: You cannot serialize or unserialize PDO instances ["
[object] (PDOException(code: 0): You cannot serialize or unserialize PDO instances at /vendor/oxid-esales/oxideshop-ce/source/Core/Session.php:411)
[stacktrace]
#0 [internal function]: PDO->__sleep()
#1 /vendor/oxid-esales/oxideshop-ce/source/Core/Session.php(411): session_write_close()
#2 /vendor/oxid-esales/oxideshop-ce/source/Core/Utils.php(1075): OxidEsales\\EshopCommunity\\Core\\Session->freeze()
#3 /source/modules/oe/example/Classes/Util.php(146): OxidEsales\\EshopCommunity\\Core\\Utils->redirect('https://www.demo...')
#4 /source/modules/oe/example/Model/Order.php(153): oe\\example\\Classes\\Util->doPayment(Object(OxidEsales\\PayPalModule\\Model\\Order))
#5 /vendor/oxid-esales/oxideshop-ce/source/Application/Controller/OrderController.php(217): oe\\example\\Model\\Order->finalizeOrder(Object(OxidEsales\\PayPalModule\\Model\\Basket), Object(OxidEsales\\PayPalModule\\Model\\User))
#6 /source/modules/wa/forcepayment/Application/Controller/ForcePaymentController.php(20): OxidEsales\\EshopCommunity\\Application\\Controller\\OrderController->execute()
#7 /vendor/oxid-esales/oxideshop-ce/source/Core/Controller/BaseController.php(524): Wa\\ForcePayment\\Application\\Controller\\ForcePaymentController->execute()
#8 /vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(332): OxidEsales\\EshopCommunity\\Core\\Controller\\BaseController->executeFunction('execute')
#9 /vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(274): OxidEsales\\EshopCommunity\\Core\\ShopControl->executeAction(Object(OxidEsales\\PayPalModule\\Controller\\OrderController), 'execute')
#10 /vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(137): OxidEsales\\EshopCommunity\\Core\\ShopControl->_process('OxidEsales\\\\Esho...', 'execute', NULL, NULL)
#11 /vendor/oxid-esales/oxideshop-ce/source/Core/Oxid.php(26): OxidEsales\\EshopCommunity\\Core\\ShopControl->start()
#12 /source/index.php(15): OxidEsales\\EshopCommunity\\Core\\Oxid::run()
#13 {main}"] []

You can debug getBasket() to see why is not unserialized.

does it work without modules?

No, it’s not working we are checking with our script file utils->redirect not passed to requested URL instead of it will clear the session by session freeze function.