Welcome Guest, Not a member yet? Register   Sign In
Database sessions with special char in user_data
#1

[eluser]timpisti[/eluser]
Hello.

When the session set up to use database, the serialized user_data is broke, when try to serialize a special character, like 'é', or 'ó'.
The problem only appear, when session use database, and user_data contain special character!
#2

[eluser]timpisti[/eluser]
Hello.

I find the solution.

If the char encode of session table in the database is different, or wrong (i.e. the session table is latin_1 and the session data is UTF-8), the session serialize will mess width the special characters.

A little message in the documentation at this part will be kindly appreciated.
#3

[eluser]Stoney[/eluser]
Thx for your contribution.

I had the same problem, and your fix works perfectly.
#4

[eluser]Michael Wales[/eluser]
I really don't see why there needs to be any additional documentation on this. In config/database.php your clearly define the charset and collation for your database - why would you then go make a table in that database different?
Code:
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

If we start warning people about common sense things like this, we'll need to start warning them about:
Code:
<?php unlink('/'); ?>
#5

[eluser]timpisti[/eluser]
Yes, you right, but if the developer use phpmyadmin or orher surfaces to develop SQL, may overlook the proper setup of all char encodes - it's not so noticeable, and the problem usually not appear at the first round in most cases.
But, as I see, this tread is perfect to warn.

Thank you.




Theme © iAndrew 2016 - Forum software by © MyBB