PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, March 1, 2022

[FIXED] Codeigniter:session not working on live website

 March 01, 2022     codeigniter, php, server, session     No comments   

Issue

I built a website using CodeIgniter. It works fine on localhost, but when I uploaded it on 000webhost it behaves incorrectly. Sessions are not setting .session and not working for live servers.

I called session in the constructor of the controller

$this->load->library('session');

I am setting its value in the method of the same controller like this

$session_array = array(
                'Username'=>'admin', 
                'Logged In'=>'TRUE',
                );
$this->session->set_userdata($session_array);

It works to set the value for just one time, but when I click on any other link it expires.


Solution

@navigator Please go to your website setting on 000Webhost and change the version of PHP to 7.0 it will work fine.



Answered By - shery089
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing