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


Messages In This Thread
"Too many redirects" Ion Auth - by vertisan - 02-12-2015, 03:12 AM
RE: "Too many redirects" Ion Auth - by tomlagard - 02-12-2015, 06:43 AM
RE: "Too many redirects" Ion Auth - by vertisan - 02-12-2015, 07:03 AM
RE: "Too many redirects" Ion Auth - by tomlagard - 02-12-2015, 10:24 AM
RE: "Too many redirects" Ion Auth - by Avenirer - 02-12-2015, 01:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB