php - Symfony: Custom Session Save Handler Maximum Execution Time -


i using symfony's custom session handler. works fine when set session first time when refresh page. page keep on loading , after 30 seconds max_execution_time defined in php.ini, errors shown. setup custom save handler, created table sessions in ratchet database. structure , data in table:

data , structure of sessions table

now script, on top of page looks initialize custom save handler:

<?php   ini_set('session.auto_start', false);  use symfony\component\httpfoundation\session\session; use symfony\component\httpfoundation\session\storage\nativesessionstorage; use symfony\component\httpfoundation\session\storage\handler\pdosessionhandler;      require dirname(__dir__) . '/vendor/autoload.php';      $pdo = new \pdo('mysql:host=localhost;dbname=ratchet', 'root', '');     $pdo->setattribute(pdo::attr_errmode, pdo::errmode_exception);     $storage = new nativesessionstorage(array(), new pdosessionhandler($pdo)); // here when pdosessionhandler class initialized again on refreshing locks page there     $session = new session($storage);      $session->start();      $username = $session->get('username'); 

the errors thrown php script line 153:

errors

line 153 statement in following method executes , reads session value database.

private function doread($sessionid) {     $this->sessionexpired = false;      if (self::lock_advisory === $this->lockmode) {         $this->unlockstatements[] = $this->doadvisorylock($sessionid);     }      $selectsql = $this->getselectsql();     $selectstmt = $this->pdo->prepare($selectsql);     $selectstmt->bindparam(':id', $sessionid, \pdo::param_str);     $selectstmt->execute(); // line 153 

is broken in framework's component or missing something? have followed documentation. can't find new or has been added myself.

addition

in addition initializing session in web app, initialize symfony session in server script because required in order attach same session object each connection. points noted:

  1. the application works fine first attempt.
  2. chat server works intended. never throws error.
  3. when page in connect websocket server refreshed, remains in loading state 30 seconds. errors occur.
  4. same happens in other browsers. let connection establish when refresh ........ see above :d

is session closing when websocket disconnects? if not, keeping lock on session record , not allowing incoming request continue past starting session. initial page load works because websocket picks session when page load complete.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -