[eluser]ping timeout[/eluser]
NO, it's not because of set_value(‘username’) - because it has the right value( no form validation errors) and anyway I changed the code to:
Code:
$this->session->set_userdata('username','test');
$this->session->set_userdata('logged_in',TRUE);
$this->load->view('personal');
And in views/personal I have
Code:
<h1>Hello <?php echo $this->session->userdata('username'); $username=$this->session->userdata('username'); ?></h1
<?php echo anchor('personal/user', 'User'); ?>
In controller personal, function user I have:
Code:
function user()
{
$this->load->view('personal_user');
}
views/personal_user:
Code:
<h1>Hello <?php echo $this->session->userdata('username'); $username=$this->session->userdata('username'); ?></h1
<?php echo anchor('personal', 'Personal'); ?>
In personal I see Hello test, when I click on User, I get only Hello.
I don't get it, anything (captcha, email, form validation...) works fine till here...
Also noticed something:
I've changed my code and it looks like this:
Code:
class Personal extends Controller
{
function __construct()
{
parent::__construct();
}
function index()
{
$this->_is_logged_in('personal');
}
function user()
{
$this->_is_logged_in('personal_user');
}
function _is_logged_in($link)
{
if ($this->session->userdata('logged_in')===TRUE)
$this->load->view($link);
$this->load->view('login');
}
}
1. index.php/personal shows views/login
2. index.php/personal/ shows views/login
3. index.php/personal/user shows views/personal_user only for IE, in FF it shows login
4. index.php/personal/user/ shows views/login