[eluser]Alhazred[/eluser]
I'm developing an application which requires a login.
On Firefox I have no problem, now I'm trying it on Chrome and Internet Explorer.
When I submit the login form a success page is shown, in this page I have a link which should send me back to the home page, but showing different content.
The link works, but the home page is shown as I'm not logged in.
Of course to know if someone is logged in I use the session, there can be any problem with the session?
How to solve it?
Some code: at the moment in the home view I call 2 views, 1 for the login/logout form and 1 for the menu
login/logout: IE and Chrome always show the login, FF shows correctly the login or logout
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$log = $this->session->userdata('logged');
if ( $log !== FALSE && $log == $this->config->item('auth_logged'))
{
//shows logout form
}
else
{
//shows login form
}
menu: IE and Chrome always show the register link, FF correctly shows the user/admin/register links
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$log = $this->session->userdata('logged');
if ( $log !== FALSE &&
$log == $this->config->item('auth_logged') &&
$this->session->userdata('level') == $this->config->item('auth_user'))
{
//show user menu
}
else if ( $log !== FALSE &&
$log == $this->config->item('auth_logged') &&
$this->session->userdata('level') == $this->config->item('auth_admin'))
{
//show admin menu
}
else if ( ! $log)
{
//show register link
}