config session data for Ajax |
[eluser]Ngulo[/eluser]
hi all , is there someone can tells me which configruation is using correctly for session using Ajax requests? mine are as shown: Code: $config['sess_cookie_name'] = '*******'; now ajax works good on my site but after n time sessions losts ....is there a perfect configuration can i use? ![]() thanks
[eluser]WanWizard[/eluser]
This config rotates the session ID every 30 seconds. If this happens on an ajax call, the next request finds an invalid session. Search for sess_update and IS_AJAX to find the solution to this known issue.
[eluser]Ngulo[/eluser]
thanks wanwizard i've search into forum but my english is very very bad ![]() so i'm hoping someone can give me directly a good configuration using not session database for my ajax site ![]() hoping yet ![]()
[eluser]Ngulo[/eluser]
sorry wan i've read but i can't understand very well englihs ![]() i see just some bite of code but i really can not understand ![]() does it means that if request is ajax request,i have to update session by $this->session->sess_update()? thanks and sorry me but it's really hard for me understand english and with translator i can't read very well in my own language. ![]()
[eluser]WanWizard[/eluser]
No, it means you have to create a MY_Session.php file in application/libraries (see the manual on extending core libraries), and copy that code in it. It will extend the session library, and will make sure the session_id isn't updated on ajax calls. It also fixed a problem with the destroy method (which is not related to your question).
[eluser]InsiteFX[/eluser]
I have updated the code in the link! I forgot the define in constants.php Also the ajax check was wrong. corrected all code. InsiteFX
[eluser]Ngulo[/eluser]
thanks men but my question now is another ![]() cause i'm not using ci session native librariy but i'm using instead this library i've found http://www.philsbury.co.uk/index.php/blo...-sessions/ must i use my_session library also with this library which uses native php session? really thankss
[eluser]InsiteFX[/eluser]
You can still add the code, just add the code to the correct method's! Also the library you are using is limited to 4kb cookies, no database. InsiteFX
[eluser]Ngulo[/eluser]
ok i put all define and library on my application. but one last question is need i to load that on autoload.php config file? or just load that only into ajax functions? thankss ![]() |
Welcome Guest, Not a member yet? Register Sign In |