Welcome Guest, Not a member yet? Register   Sign In
Session problems
#1

Hi All,

I need to understand how session class works in Codeigniter. The reason is that I have an application hosted on IIS, PHP and mySQL (windows server), which randomly logoff users before the cookie expires. Sessions are using database and expire is set to 1 day.
If anyone can help, it will be greatly appreciated.
Reply
#2

@scarpelius,

Did you read the CI documentation ( https://codeigniter.com/user_guide/libra...on-library )? It should be able to answer your question?
Reply
#3

Ofc i did. But is not enough.
Reply
#4

You can try to extend the garbage collector manually in your php.ini.
Everything in CI are plain PHP so you can just open up the Session class and study the code.
Reply
#5

I can't remember if our sessions dropped or did it make the site slow, but in the end the issue we ran into was database table lock.

Once we changed to file based sessions until we could move to Redis or Memcache solution, haven't had any issues since.

Could be worth swapping it over just to see if it stops users being logged out.
Reply
#6

@scarpelius,

Can we see your config settings for sessions? Also, are you following the conditions for using a database ( https://codeigniter.com/user_guide/libra...ase-driver )?
Reply
#7

$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 86400;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
Reply
#8

(This post was last modified: 08-08-2018, 08:02 AM by scarpelius.)

To be clear, I do not expect anyone here to solve my problem. Rarely you can find an answer, when you cant define the problem.
I just wanted a walk through the design of sessions in codeigniter. It is true I can look at the code and learn from there, but I dont have the time to do that.
Reply
#9

@scarpelius,

I see a few that I'm not familiar with. Did you add some custom ones?

Also, what about 'sess_driver' 'sess_save_path'?

What version of CI are you using?
Reply
#10

(This post was last modified: 08-08-2018, 08:25 AM by scarpelius.)

It is CI 2.x

2.2.6
Reply




Theme © iAndrew 2016 - Forum software by © MyBB