php - CodeIgniter authentication concept issue -


i've made ci authentication controller allowing user log site, , after login i'm redirecting him visited url keep using:

$this->session->set_flashdata( 'return_url', current_url() ); 

unfortunately causes problem. every time when user opens more 1 tab in browser variable being overwritten , after successful login user redirected same url in tabs.

so question is: is possible load custom controller inside my_controller? (my_controller class extends ci_controller)

i tried using (inside constructor of my_controller) didn't worked out:

$ci =& get_instance(); $ci->router->set_class('authentication'); $ci->router->set_method('login'); 

edit: appreciate other ideas of solving problem.

a solution not save return url in session var, pass around in get/post parameter (in case of get, encoded, base64 ie.). addition have standard return url if no (valid) return url set

--- edit why talking base64 when php has function this; urlencode friend! http://nl3.php.net/urlencode


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -