stop logged in users accessing login page. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: stop logged in users accessing login page. (/showthread.php?tid=47497) |
stop logged in users accessing login page. - El Forum - 12-11-2011 [eluser]gazza7364[/eluser] Hi I'm trying to stop logged in user from accessing the login page and logged out users accesing pages without authentication. I can stop users from accesing pages with the following code:= Controller Code: function is_logged_out() but if I try the following to stop logged in users from accessing the login page. Code: function is_logged_in() it sends to the first code thinking I,m logged out, when I'm logged in. which the puts it into a loop. The session is started if the credentials are correct when logging in. I'm not sure why the logged out version will work but not the logged in version. I have tested the session to see if their is any, which comes back true. The sesson is set with the following code Code: $ses = array( Any help will be appreciated, |