[eluser]dinhtrung[/eluser]
Seems like the error appears because of setcookie() function in Sessions library, not by Tank_Auth. Because redirect() use header to redirect the page, too, and setcookie() also a header function, so this collision appears. As a replacement, you could render an auto-update page and redirect later. I usually did this:
Code:
function __construct()
{
parent::__construct();
if ($this->tank_auth->is_logged_in == FALSE){
$info['message'] = "You are not logged in. Please login to continue."; # Message to display to the user.
$info["url"] = site_url('auth/login'); # The url we gonna redirect to
# $info['time'] = 2; # Number of seconds the info page should be display before redirect.
echo $this->load->view('info', $info, TRUE);
exit;
} else ....
For the info view in the last echo statement:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html >
<head>
<meta http-equiv="refresh" content="<?= (isset($time))?$time:'1000' ?>; URL=<?= $url; ?>">
<title>Information</title>
</head>
<body>
<h3>Information</h3>
<p class='notice'><?= $message; ?></p>
</body>
Please feed back if this method works.