How to verify if a user is logged in? |
Im using a session database. I set some custom data in the session:
Code: $sessiondata=array('username'=>$username, 'loginuser'=>TRUE); So I set username and loginuser, then enter these values in ci_sessions table matching the session_id so that it is for the same user. So login kinda works and the user is redirected to admin.php. What if I go to admin.php directly how do I verify if the user is logged in and is allowed to access admin.php? I want to match data against ci_sessions table.
Do the one thing you think you cannot do. Fail at it. Try again. Do better the second time. The only people who never tumble are those who never mount the high wire.
|
Messages In This Thread |
How to verify if a user is logged in? - by lexxtoronto - 04-20-2015, 12:51 PM
RE: How to verify if a user is logged in? - by paju89 - 04-20-2015, 02:27 PM
RE: How to verify if a user is logged in? - by lexxtoronto - 04-20-2015, 03:05 PM
RE: How to verify if a user is logged in? - by silentium - 04-20-2015, 03:24 PM
RE: How to verify if a user is logged in? - by lexxtoronto - 04-20-2015, 04:45 PM
RE: How to verify if a user is logged in? - by RogerMore - 04-21-2015, 01:23 AM
RE: How to verify if a user is logged in? - by lexxtoronto - 04-22-2015, 08:14 AM
RE: How to verify if a user is logged in? - by madaan_tushar - 05-25-2015, 11:34 PM
|