I am starting to learn about PHP using Codeigniter. My task is to build up a website which has several functions including registration system, login with different roles (user or admin) and maintain login session until clicking logout.
Now, I have done those mentioned functions. However, I am confused by this thing: How can I have a site that is corresponding to login session? I mean the user can view the site normally when they haven't logged in. At that time, on the navbar there will always appear the SignUp and LogIn buttons regardless which pages they are accessing. One they've signed in, they are allowed to do more things such as comment on a post and the navbar will appears LogOut button (not the other two). In this case, similarly, the LogOut button will stay there whenever they visit a page of the website.
I have uploaded my project into Github here
I hope that someone could help me. Thank you in advance.
Cheers