Session_start () is not successful when using multiple bytes in a session in cakephp3

I recently started using cakephp3.1 and I get an error that is lower.

Warning (2): session_start (): attempt to destroy an uninitialized session [CORE / src / Network / Session.php, line 324]

Warning (2): session_start () [function.session-start]: Failed to decode the session object. Session was destroyed [CORE / src / Network / Session.php, line 324]

Warning (2): session_start () [function.session-start]: Unable to send session cache limiter - headers have already been sent (output started in /home/www/service/vendor/cakephp/cakephp/src/Error/Debugger.php : 742) [CORE / src / Network / Session.php, line 324]

When I set a multibyte word to a session, for example, the login username is Japanese or something multibyte set to blink, this happens.

So, I assumed that the mbstring extension is not installed. However, it is already installed.

+5
source share
3 answers

This usually happens because the session store cannot handle multibyte characters. If the repository is a mysql database, then install

Character Set - utf8

Utf8_general_ci value

for the table and the field containing the session data , solves these problems.

+1
source

Use base64_encode () This may be useful for using a multibyte string. I use it for the Hindi language.

0
source

Set database encoding to utf8_general_ci

0
source

Source: https://habr.com/ru/post/1233403/


All Articles