Welcome Guest, Not a member yet? Register   Sign In
Session Lost on firefox in first attempt
#3

(04-19-2021, 06:04 AM)kleber Wrote: It seems to me that you are trying to use native PHP session. This is not necessary if you load the codeigniter session library.

If you send the corresponding excerpt from your controller it can help clarify the problem.

Thank you for your response, Below is my controller code.


<?php
defined('BASEPATH') or exit('No direct script access allowed');

class Home extends CI_Controller
{
public function __construct()
    {
        // Call the CI_Model constructor
        parent::__construct();

        // For debugging
        $this->output->enable_profiler(TRUE);
    }

    // Below method trigger via ajax
    public function setSessiondata()
    {
        $user_info = $_POST['user_info'];
        if ($user_info['screen'] == '4')
        {
            $data = array(
                'user_id' => $user_info['userid'],
                'userId' => $user_info['userid'],
                'firstName' => $user_info['fullname'],
                'fullname' => $user_info['fullname'],
                'lastName' => "",
                'email' => $user_info['email'],
                'userType' => $user_info['usertype'],
                'phoneNumber' => $user_info['phone'],
                'imageUrl' => $user_info['userprofilepic'],
                'thumbimageUrl' => $user_info['userthumbprofilepic'],
                'cityName' => $user_info['cityname'],
                'stateName' => $user_info['statename'],
                'countryName' => $user_info['countryname'],
                'extension' => $user_info['extension'],
                'extPass' => $user_info['extpass'],
                'verificationStatus' => $user_info['verificationstatus'],
                'countryId' => $user_info['countryid'],
                'client_id' => $user_info['clientid'],
                'screen' => $user_info['screen'],
            );
            $this->session->set_userdata('logged_in', $data)
        }
        else
        {
            $usrType = "Business";
            if ($user_info['screen'] == '2')
            {
                $usrType = "Individual";
            }
            $data = array(
                'firstName' => $user_info['fullname'],
                'fullname' => $user_info['fullname'],
                'lastName' => "",
                'email' => $user_info['email'],
                'userType' => $usrType,
                'screen' => $user_info['screen'],
            );

            $this->session->set_userdata('logged_in', $data)
        }

       
       
        die('true');

    }

    /* Here when I print the session information it always gives nothing  */
    public function dashboard()
    {
      /*echo 'session id =='.session_id();
        echo '<pre>';
        print_r($this->session->userdata('logged_in'));
        print_r($_COOKIE);*/
        $data = array();
        $this->load->view('admin/dashboard', $data);
    }

    public function logout()
    {
        $this->session->sess_destroy();
        redirect('login', 'refresh');
    }

}

?>


 One more thing I have recently noticed that, every time multiple session files have been created, And I am attaching a recently created session file for first attempt login.

I don't get it when a session is created and saved in the file, then why doesn't it read that file even when permission is fine (I have tried 0700 and 0777 both, 777 for testing purpose only).   


Please help me to figure out this issue. This only happens in firefox in first attempt.
Reply


Messages In This Thread
RE: Session Lost on firefox in first attempt - by Aimmi1904 - 04-22-2021, 01:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB