Replicating the same fixes done to DatabaseSession in CacheSession
Replicating the same fixes done to DatabaseSession in CacheSession

Fixes #9872

mvdriel/cakephp,ADmad/cakephp,garethellis36/cakephp,ADmad/cakephp,CakeDC/cakephp,dakota/cakephp,garethellis36/cakephp,tenkoma/cakephp,ADmad/cakephp,CakeDC/cakephp,cakephp/cakephp,davidyell/cakephp,tenkoma/cakephp,ndm2/cakephp,tenkoma/cakephp,davidyell/cakephp,CakeDC/cakephp,petteyg/cakephp,cakephp/cakephp,mvdriel/cakephp,cakephp/cakephp,petteyg/cakephp,ndm2/cakephp,tenkoma/cakephp,CakeDC/cakephp,garethellis36/cakephp,ADmad/cakephp,dakota/cakephp,dakota/cakephp,cakephp/cakephp,petteyg/cakephp,ndm2/cakephp,mvdriel/cakephp,ndm2/cakephp,davidyell/cakephp,dakota/cakephp,petteyg/cakephp,berrygoudswaard/cakephp,berrygoudswaard/cakephp,garethellis36/cakephp,mvdriel/cakephp,berrygoudswaard/cakephp