Welcome Guest, Not a member yet? Register   Sign In
Solution to session data loss when using AJAX
#31

[eluser]froozle[/eluser]
There is a race condition with the CI session.
A fix is proposed here:
http://www.hiretheworld.com/blog/tech-bl...conditions

It's already been submitted to CI on github as a pull request.

https://github.com/EllisLab/CodeIgniter/pull/1713
#32

[eluser]MissionMan[/eluser]
[quote author="froozle" date="1345489549"]There is a race condition with the CI session.
A fix is proposed here:
http://www.hiretheworld.com/blog/tech-bl...conditions

It's already been submitted to CI on github as a pull request.

https://github.com/EllisLab/CodeIgniter/pull/1713[/quote]

Forgive my ignorance but I haven't been using CI for long.

I have copied the code from www.hiretheworld.com What file do I put it in and where do I place that file?

Thanks.
#33

[eluser]froozle[/eluser]
You need to extend the session library.
So Take the content of that file and put it in MY_Session ( if MY_ is the prefix to your extensions - You can find this inside your application/config.php file )

Put the My_Session file inside application/libraries and you should be good to go.

Cheers
#34

[eluser]WanWizard[/eluser]
[quote author="froozle" date="1345489549"]There is a race condition with the CI session.
A fix is proposed here:
http://www.hiretheworld.com/blog/tech-bl...conditions

It's already been submitted to CI on github as a pull request.

https://github.com/EllisLab/CodeIgniter/pull/1713[/quote]
Yeah, by a guy that shamelessly takes my old solution (see a few posts back) and puts it forward as his own.

It's not a fix, it's a workaround, and not a very good one, as it will basically only double the session ID rotation timeout. Going for InsiteFX's solution of disabling session ID rotation on ajax calls is a much cleaner workaround, one which works pretty well.
#35

[eluser]froozle[/eluser]
I'm quite confident he didn't just "take your old solution" and put it forward as his own. That's quite insulting. I didn't read a few posts back. This solution was implemented a while back, and if you have the same one, then that's great. The point of this forum is not to attack anyone, but to provide possible solutions.

If you read the actual post, you'll see that it doesn't just happen on ajax requests. It could happen with normal requests as well. Either way, it works for us Smile




Theme © iAndrew 2016 - Forum software by © MyBB