Welcome Guest, Not a member yet? Register   Sign In
[CI3 session on Safari]
#1

I got a problem with the CodeIgniter session when users use Safari from PC or Tablet. On Google Chrome and Firefox Dev Edition is working perfectly i think the problem is related with Safari.

That's my code for the session after the success log-in:

$logged_in = array(
'username' => $out[0]['username'],
'user_id' => $out[0]['id'],
'logged_in' => TRUE
);

$this->session->set_userdata($logged_in);
$this->session->set_flashdata('user_data',$logged_in);

redirect('social/userprofile/'.$out[0]['username']);

Any suggestions?
Reply
#2

What is the problem you are having with session?
TastyIgniter - Open Source Restaurant Ordering and Management System
Reply
#3

The problem is: When a user make a login using Safari he is redirected again in the Log-In page instead the profile page.
This because:

$check_session = $this->session->userdata('user_id');
if(empty($check_session)) {
redirect('social/index');
}

During the Log-In i Set the session for the user. In Chrome and Firefox is all OK but on Safari the session is completely empty.
Reply
#4

I think the problem is Safari.. I'm saving the Session as files in a dir. The log-in with Chrome generate 1 session file with all the info, Safari generate 3 or more session files for same log-in 1 with the right information and the others with just: __ci_last_regenerate|i:1443966977;
all files have same i:1443966977 but the only one with the right information saved have a different number.
Reply
#5

The same Code, on same server but just with different domain and CI Version 2.2 is working on Safari !
Reply
#6

I'm not sure about this as i never experienced such problem before, but have you checked that your cookie_domain and cookie_path is set correctly.
TastyIgniter - Open Source Restaurant Ordering and Management System
Reply
#7

Is sess_match_ip enabled? If so, disable it.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB