Welcome Guest, Not a member yet? Register   Sign In
Session keeps "breaking" on me.
#1

[eluser]Vinnie Saletto[/eluser]
So, my current task involves a site where people can sign in, and view a series of training videos on a particular topic. The only trouble is that once I have them log in, and I create a session, that session seems to mysteriously disappear after a few minutes. This is the block of code in my config.php page:

Code:
$config['sess_cookie_name'] = 'cc_session';
$config['sess_expiration'] = 0;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'cc_sessions';
$config['sess_match_ip'] = TRUE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 3000000;

Why is sess_time_to_update set so high? At first, I thought that was the culprit, updating the session after 5 minutes. I have set the session to record to a database, and all that good stuff. Please, ask me questions, and help me get to the bottom of this! Thank you!
#2

[eluser]Vinnie Saletto[/eluser]
I will add that I am NOT running AJAX on this page. In my viewer I have this code to create an iFrame that will "ping back" the server every minute. This is a quick and dirty stop gap measure to let the server know that this person is currently viewing the course, and has viewed the course for _____ minutes. The name of the site is removed for obvious reasons!

Code:
<iframe id="timerAddEnd" src="http://____._____.org/course/finish/<?=$course->intKey?>/ping" ></iframe>
Script tag removed here
Code:
var auto_refresh = setInterval(
  function () {
   var iframe = document.getElementById('timerAddEnd');
   iframe.src = iframe.src;
  }, 60000); // refresh every minute
Script tag removed here
#3

[eluser]theshiftexchange[/eluser]
A few things to try:

Change cookie name to 'ccsession'; - you should not have a "_" in a cookie name, causes issues

$config['sess_match_ip'] = TRUE; <- try setting this to false - you might have a cycling IP


$config['sess_match_useragent'] = TRUE; <- try setting this to false




Theme © iAndrew 2016 - Forum software by © MyBB