Welcome Guest, Not a member yet? Register   Sign In
base_url turns up twice after redirect


i use DX_Auth for login in my application, and after logging in, i want to take the user back to the page where he came from. Please note that I use a lightbox login window.

It works fine, but after the redirect, the URL is incorrect, it shows my base_url and then the full path of the referrer. Like this:


The controller:

function login()
        if ( ! $this->dx_auth->is_logged_in())
            $val = $this->form_validation;
            // Set form validation rules
            $val->set_rules('username', 'Username', 'trim|required|xss_clean');
            $val->set_rules('password', 'Password', 'trim|required|xss_clean');
            $val->set_rules('remember', 'Remember me', 'integer');
            $hello = $this->agent->referrer();

            // Set captcha rules if login attempts exceed max attempts in config
            if ($this->dx_auth->is_max_login_attempts_exceeded())
                $val->set_rules('captcha', 'Confirmation Code', 'trim|required|xss_clean|callback_captcha_check');
            if ($val->run() AND $this->dx_auth->login($val->set_value('username'), $val->set_value('password'), $val->set_value('remember')))
                // Redirect to homepage
            { .......blablabla

What do i do wrong? Please help!

you can set a session variable before redirecting to login.
after successfully logged in u can simply redirect like this.

Happy Coding,

Thanks!!!!! Smile
You cannot imagine how many hours I was playing around with this, and with your hint, it works.

thanks again.

Theme © iAndrew 2016 - Forum software by © MyBB