Welcome Guest, Not a member yet? Register   Sign In
store last requested page -> login -> send back to page !- ajax
#1

[eluser]jstrebel[/eluser]
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:

$this->db_session->set_flashdata('requested_page',$this->uri->uri_string());

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.




Theme © iAndrew 2016 - Forum software by © MyBB