Problema de sesión en codeigniter para caracteres árabes

I am just stuck with a issue regarding session. I have a multilingual ecommerce site for english and arabic language. In case of arabic language when someone registers with a arabic name, description or such fields s/he can register successfully. But during login the session data being lost.

Actually when setting all the data into a session array its being stored and i tested it by printing the array. But after the valid authentication when user being redirected to index page or profile page then the session array disappears. The full array being lost. and login doesnt working. Its only happening for someone who has arabic fields on their data. for english its perfectly ok.

I have removed the session.php from syatem/libraries directory. Then it works only on localhost, on server it creates problem when ordering or viewing items of a particular org.

Any suggestion will be accepted cordially.

Muchas Gracias

preguntado el 05 de septiembre de 12 a las 10:09

well actually checked everything related these... utf_8 encoding. and database collation is unicode also. no prob with that. but only session being lost when redirected to another page. -

Are you using database to store the session data? -

i have test it there is no problem in CI Session with Arabic letters i put uses just a random arabic string $this->session->set_userdata(array('username'=>'نظمت إدارة شؤون','desc'=>'حلم تحسين المعيشة يوقع فتاة في مصيدة الرذيلة','id'=>'123')); and its work fine tested in firefox, chrome, and IE -

To confirm, the english language logins work as expected? -

If you are using a table to store session data, check the database class config inside application/config/database.php. Specially $db['default']['char_set'] = "utf8"; -

2 Respuestas

Thank u so much all of u for your reply.... and my issue has been solved.

Unfortunately my session table user_data field collation was not utf8_unicode. Thats why the data was being lost when it redirects to home page. Since it is using the ci_session table. Its working now nicely.

Before posting the question i have tried using native session, updated the Session.php file on system/libraries....But haven't got the perfect solution.

But finally could have figured out the silly mistake and done with the issue.

Cheers to all....:D

Muchas Gracias

Respondido el 19 de Septiembre de 12 a las 07:09

Por favor intente usar Native Session en lugar de predeterminado CI_Session and see if your problem will be solved?

Here is a link for you:

https://github.com/appleboy/CodeIgniter-Native-Session

Respondido el 15 de Septiembre de 12 a las 14:09

Hey, Thank u so much for your reply.... and my issue has been solved. and before posting the question i tried using native session to resolve it, but that incurs problem during the placement of an order and further processing..... CI session is fine.... Thanks - Nandinee

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.