Welcome Guest, Not a member yet? Register   Sign In
CI Session Crashes When Saving UTF-8 Characters
#1

[eluser]Unknown[/eluser]
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:
Code:
$this->session->set_userdata('custom_filters', 'Some Kind of String');


This line of code DOES crash the session:
Code:
$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:
Code:
$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.
#2

[eluser]Julius Š.[/eluser]
I am having the same problem. And it seems that this bug happens not only when you store your sessions in a database, but also when $config['sess_use_database'] is set to false.
#3

[eluser]Julius Š.[/eluser]
I fixed my problem, I was fetching data from a database with a non utf-8 charset. I changed the charsets of my database, tables and fields to utf8_general_ci and that solved my problem.




Theme © iAndrew 2016 - Forum software by © MyBB