Welcome Guest, Not a member yet? Register   Sign In
session problem
#1

(This post was last modified: 02-11-2015, 07:01 AM by sintakonte. Edit Reason: typo )

Hey guys, 
i could need some advice - because i'm experiencing a randomized session error from time to time and i don't know whats going on;
Whats the matter:
I'm losing from time to time my session

My Environment:

  • Apache 2.4.9
  • PHP 5.5.13
  • session.save_handler = redis 
  • in php.ini
  • CI V3 RC2
  • a modified version of Wiredesignz HMVC for CI
CI Config:
PHP Code:
$config['sess_driver']        = 'redis';
$config['sess_cookie_name']    = 'app';
$config['sess_expiration']    = 31536000;
$config['sess_match_ip']    = FALSE;
$config['sess_time_to_update']    = 300;
$config['sess_save_path'      "tcp://127.0.0.1:6379"


Error / Debug Messages from the log.php
Code:
DEBUG - 2015-02-11 14:30:28 --> Total execution time: 9.1220

ERROR - 2015-02-11 09:58:08 --> Severity: Notice --> Undefined variable: session_id \system\libraries\Session\drivers\Session_redis_driver.php 384

ERROR - 2015-02-11 09:58:08 --> Session: Error while trying to free lock for ci_session:


I can reproduce the error - because it seems its related to ajax calls (but not all, just a few)
And only those where the execution time is really long (because of other SOAP webservices etc.)

Any advice is much appreciated;

If you need more info - pls let me know;

thx in advance
Reply
#2

https://github.com/bcit-ci/CodeIgniter/c...94316b4e57

However, I'm not sure if anything could be done about long execution times ... Emulated locks, such as those that we do for Redis, can't be held forever and there has to be some time value associated with them. I'd reconsider my approach if any page load takes more than 5 seconds, especially for AJAX calls.
Reply
#3

thx Narf

about reconsidering the approach - i've no choice, my APP depends on other SOAP Services and this Navision Webservices are not in my hands right now ...
Reply
#4

That you don't have control over the remote service is not the problem ... I'd ask the following questions:

- Do those SOAP calls really need to be executed during a page load?
- Does the session have to be active during those SOAP calls? (you can open, read & close beforehand)
- Do you really need to use Redis for session storage?
Reply
#5

Added notes to the docs: https://github.com/bcit-ci/CodeIgniter/c...56c8db3e64
Reply




Theme © iAndrew 2016 - Forum software by © MyBB