0

When a logged in user views a page that's putting UTF-8 characters in a session, it crashes their session data and they're redirected to login page. It works when this happens with non-UTF-8, only when our client with Japanese contacts does this action. I don't get any kind of error or warning, the session just crashes which means the user is redirected to a login page.

This line of code does NOT crash the session:

$this->session->set_userdata('custom_filters', 'Some Kind of String');

This line of code DOES crash the session:

$this->session->set_userdata('custom_filters', 'コミュニケーションズ株式会社');

My ci_sessions table encoding in my database is set to UTF-8, and here is my relevant database config:

$db['default']['char_set'] = "utf8";

$db['default']['dbcollat'] = "utf8_general_ci";

Any help you can give is much appreciated. Let me know if you'd like to see any of my other settings.

AaronPresley
  • 425
  • 1
  • 4
  • 8

1 Answers1

0

If you are Saving Session Data to a Database, do make sure that the Character Set and Collation are set to utf8 and utf8_unicode_ci respectively.

This is what caused my CI Session to crash when using unicode.

Steven Teo
  • 687
  • 6
  • 6