Welcome Guest, Not a member yet? Register   Sign In
"Too many redirects" Ion Auth
#1

(This post was last modified: 02-12-2015, 09:32 AM by vertisan.)

Hello!

I creating login system with Ion Auth, I got this code:
PHP Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class 
Main extends CI_Controller {

 function 
__construct() {

 
parent::__construct();
 
$this->load->library( array( 'ion_auth' ) );

 }

 public function 
index()
 {

 
$this->load->view'templates/main/header' );
 
$this->load->view'templates/main/navigation' );
 
$this->load->view'Home' );
 
$this->load->view'templates/main/footer' );

 } 
// END: index()

 
public function logowanie()
 {

 
$data $this->data['title'] = "Login";

 
$this->load->view'templates/main/header'$data );
 
$this->load->view'logowanie' );
 
$this->load->view'templates/main/footer' );

 if ( isset(
$_POST) ) {

 
$login $this->input->post'username' );
 
$password $this->input->post'password' );

 
$login_process $this->ion_auth->login$login$password );

 if ( 
$login_process ) {
 
redirect'panel' );
 } else {
 
redirect'main/logowanie' );
 }
 
 }
 } 
// END: logowanie()

 
public function logout()
 {
 
$logout $this->ion_auth->logout();
 
redirect('/''refresh');
 }


// END: class Panel

/* End of file Main.php */
/* Location: ./application/controllers/Main.php */ 

and i getting error: This webpage has a redirect loop | Too many redirects

Why?
Reply
#2

What version of CI are you using?
Reply
#3

CodeIgniter 3.0 RC2
Reply
#4

Check out

https://github.com/benedmunds/CodeIgniter-Ion-Auth

as there has been discussion of CI 3 and Ion-Auth
Reply
#5

where is Panel controller? or the controller/method that you redirect to 'panel'?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB