for some shared hosting provider espicially based on os litespeed make Codeigniter session lost or late after redirecting function.
example case we set session
$this->db->set_userdata('car', 'Honda'). On first response Codeigniter will succeed save session with value Honda, but if we set again with new value like
$this->db->set_userdata('car', 'Ducati') session value still ‘Honda’ except we give space for a few second.
the solution is add on your .htaccess with this code
CacheDisable public /
CacheDisable private /
then refresh your site. good luck and don’t forget to drink your coffee