cakephp / authentication

Authentication plugin for CakePHP. Can also be used in PSR7 based applications.
MIT License
115 stars 100 forks source link

Impersonate issue with serialization for session #606

Closed rochamarcelo closed 1 year ago

rochamarcelo commented 1 year ago

The method AuthenticationComponent::impersonate results with the error Serialization of 'Closure' is not allowed.

This error is fixed by calling the method getOriginalData : $identity = $this->getIdentity()->getOriginalData();

Error trace:

session_write_close
CORE/src/Http/Session.php:381
Cake\Http\Session->close
CORE/src/Http/Server.php:93
Cake\Http\Server->run
ROOT/webroot/index.php:40