Database sessions with special char in user_data - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Database sessions with special char in user_data (/showthread.php?tid=13396) |
Database sessions with special char in user_data - El Forum - 11-20-2008 [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! Database sessions with special char in user_data - El Forum - 02-24-2009 [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. Database sessions with special char in user_data - El Forum - 02-26-2009 [eluser]Stoney[/eluser] Thx for your contribution. I had the same problem, and your fix works perfectly. Database sessions with special char in user_data - El Forum - 02-26-2009 [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"; If we start warning people about common sense things like this, we'll need to start warning them about: Code: <?php unlink('/'); ?> Database sessions with special char in user_data - El Forum - 02-27-2009 [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. |