CodeIgniter Forums

Full Version: store last requested page -> login -> send back to page !- ajax
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I am using the Freak Auth lib, and in MY_Controller (every page load) I am setting a session variable to store the last page requested:


Freak Auth's login routine checks for this, and after login, does a nice job of putting you on the page you requested before auth.

I am having a problem though that if a controller is requested via AJAX.. and auth check fails, after login it sends the user to the ajax controller, not the fully rendered page that included the ajax call.

xample page is /foo/bar/1 and the link clicked is an ajax call to /vote/cast, auth check fails.. /vote/cast is being stored as requested page.. so after login, a small view snippet for a vote box is all the you see, as the controller is only meant to be accessed via ajax, not directly.

i am sure the solution is simple, but my head is slow tonight.