Welcome Guest, Not a member yet? Register   Sign In
config session data for Ajax
#1

[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']        = '*******';
$config['sess_expiration']        = 0;
$config['sess_encrypt_cookie']    = TRUE;
$config['sess_use_database']    = FALSE;
$config['sess_table_name']        = '********';
$config['sess_match_ip']        = FALSE;
$config['sess_match_useragent']    = FALSE;
$config['sess_time_to_update']     = 30;

now ajax works good on my site but after n time sessions losts ....is there a perfect configuration can i use? Smile)

thanks
#2

[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.
#3

[eluser]Ngulo[/eluser]
thanks wanwizard i've search into forum but my english is very very bad Sad

so i'm hoping someone can give me directly a good configuration using not session database for my ajax site Smile

hoping yet Smile))
#4

[eluser]WanWizard[/eluser]
See http://ellislab.com/forums/viewreply/820052/
#5

[eluser]Ngulo[/eluser]
sorry wan i've read but i can't understand very well englihs Sad((

i see just some bite of code but i really can not understand Sad(

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. Sad(
#6

[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).
#7

[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
#8

[eluser]Ngulo[/eluser]
thanks men but my question now is another Tongue

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
#9

[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
#10

[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 Smile)




Theme © iAndrew 2016 - Forum software by © MyBB