• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AJAX requests creating multiple sessions.

#1
[eluser]petrie[/eluser]
Hey everybody,

Despite having read the forums I can't seem to solve my AJAX/session issues, so here's the scenario I'm dealing with:

I have a section of a site that operates inside of a modal dialog. When the user has the dialog open there are a variety of menu options. Each option is loaded via AJAX (with jQuery) into the dialog. Some of the sections contain forms that also get submitted via AJAX and post back to themselves (i.e reload the dialog contents).

Navigating from section to section inside of the dialog works fine.

Whenever you post a form inside of the dialog things start to fall apart. Here's a few cases:

1 - The dialog is open and the user submits a form via AJAX. The form posts to a controller and the controller ends with

Code:
$this->load->view('view_name');

The view loads fine, but for some reason CI creates a second session.

2 - Same scenario as (1) but instead of loading a view I redirect the user. Again everything works as expected, but in this case, by the time the second request is completed CI has created a third session.

Despite all of this occurring behind the scenes, the problem is that any flashdata that is set doesn't exist in all of the sessions. Obviously that's an issue if Im trying to give the user feedback.

Having read the forums, I can also say that I have already tried to following:

1 - I have added the IS_AJAX fix but it seems to have no effect.
2 - I have extended the 'sess_time_to_update' config item to longer than 300 seconds.

I think my issue is very similar to a lot of others I've read about, but most session issues seem to deal with storing them in a DB (which I am NOT doing) and sessions disappearing altogether. My issue is that I have too many.

Can anyone shed any light on why this would happen?

Thanks.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.