Search the Community
Showing results for tags 'session'.
-
This post is about "Logged out user session due to inactivity." When I'm taking a lesson with StudioWeb, I often experiment with code in the code editor then get back on StudioWeb. The problem is that the session almost always times out. So I need to log back in then click and click to get back to where I left out. I find it's quite destructive for a flow of learning. How can I change the session time out? Thanks, Mack
-
Hello, I just used Codeigniter here. And i'm just a beginner. In this case, i want to make a homepage. If guests open the homepage, the main menu will be : -Home -Gallery -About -Contact Us But, if admin open the homepage (After log in), the main menu will be : -Home -Gallery -About -Contact Us So, I tried to use this code FOR EACH CONTROLLER : public function index() { $this->load->helper('html'); $this->load->helper('url'); if($this->session->userdata('logged_in')) { $session_data = $this->session->userdata('logged_in'); $data['title'] = 'Home - Rubalang'; $data['username'] = $session_data['username']; $data['id'] = $session_data['id']; $data['name'] = $session_data['name']; $data['position'] = $session_data['position']; $this->load->view('templates/header', $data); $this->load->view('templates/menu1'); $this->load->view('home/home1'); $this->load->view('templates/footer', $data); } else{ $data['title'] = 'Home - Rubalang'; $this->load->view('templates/header', $data); $this->load->view('templates/menu1'); $this->load->view('templates/menuadmin'); $this->load->view('home/home1'); $this->load->view('templates/footer', $data); } } We can see, I've made 3 sections of menu. menu1 and menuadmin. I do this because if i combine thoose two menu, i can't separate which menu can be seen by Admin, and which menu can be seen by user/guests. But Actually it's tedious and troublesome. I have to write that code on every controller (Because that is main menu) Is there any proper way to implement that ?
- 6 replies
-
- Codeigniter
- Session
-
(and 1 more)
Tagged with: