Welcome Guest, Not a member yet? Register   Sign In
CI 2.0 Session library
#1

[eluser]Ngulo[/eluser]
Hi all,

i would like to know if is there any problem using main CI 2.0 session lib into my 1.7.2 CI version applications ... !?

i know with CI2.0 session lib we can choose if to delete sessions after browser is closed...right?

and so what about with ajax? any updates for ajax request and session lost?

thanks guys...i wouldl ike early to try that lib on my "old" CI version apps
#2

[eluser]cideveloper[/eluser]
I dont know if this is possible but I have been messing around with CI2 and the session die on browser close doesnt seem to be working for me.
#3

[eluser]WanWizard[/eluser]
Try it, and see if it works.

But it's not needed, there is a simple solution via a MY_Session extension, posted here several times. Use the search.

The CI session library is NOT concurrency-safe. And that is true both for ajax calls and for opening the site in multiple browser windows. The only quick fix is to disable session id rotation.
#4

[eluser]Ngulo[/eluser]
Ok i'll try that but what you mean ,Wanwizard , with "id rotation"?

session_time_to_updated ?

Smile
#5

[eluser]WanWizard[/eluser]
Yes.

Every "sess_time_to_update" seconds, the session library generates a new session id, and updates both the database record and the session cookie. Session id's are generated at random.

If you have concurrent requests, and the updated timestamp in the session cookie indicates it's time to rotate, the first request rotates from id A to id B, and sents back a cookie to the browser. The second request (which has sent its cookie to the server before the updated cookie was received from the previous request) will attempt to rotate the id as well. But at this time, session id A doesn't exist anymore. So the session library enters a "session not-found" state, and creates a new empty session, and sents that cookie back, overwritting the first cookie that was valid.

Result: you lost your session.




Theme © iAndrew 2016 - Forum software by © MyBB