5

Recently I started to use cakephp3.1 and I get the error that bellow.

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

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

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

When I set multi byte word into the session such as login user's name is Japanese or something multi byte word set to flash, it's happen.

So I assumed I did't installed mbstring extension. However there's already installed.

Community
  • 1
  • 1
  • `Cannot send session cache limiter - headers already sent (output started at /home/www/service/vendor/cakephp/cakephp/src/Error/Debugger.php:742)` - what is the output - it's an error message you need to read and fix. – AD7six Oct 12 '15 at 06:28

3 Answers3

1

This generally happens due to the session storage not being able to handle multibyte characters. If the storage is a mysql database then setting the

Character Set to utf8

Collation to utf8_general_ci

for the table and the field holding the session data solves these problems.

Cemal
  • 1,469
  • 1
  • 12
  • 19
0

Use base64_encode() This may be useful for you using multi byte string I'm using it for Hindi language.

mario.van.zadel
  • 2,919
  • 14
  • 23
rb nagar
  • 1
  • 4
0

Set database encoding to utf8_general_ci