2

My Website is for internal purpose, I have checked in all request if user session is there or not. but it get expire if user is idle, I have set session like.

$time = 18000;
$config = new \Zend\Session\Config\StandardConfig();
$config->setGcMaxlifetime($time);
$config->setGcDivisor(100);
$config->setGcProbability(1);
$config->setRememberMeSeconds($time);
$sessionManager = new \Zend\Session\SessionManager($config);
$sessionManager->rememberMe($time);

but also it is expire in some minutes, pls help me to solve this. I have spend lots of time in googling, but doesn't find any solution.

sshow
  • 8,820
  • 4
  • 51
  • 82
user3157253
  • 83
  • 1
  • 6

1 Answers1

0

In principle, I avoid using cookie.
I use ZF1 and here is my setup:
In your example, the terms are the same and I'm sure you can adapt:

Add repertory for save your session (see APPLICATION_PATH . '/../tmp' in the code)

// Production
     'session' => array(    'use_cookies'         => true,
                            'use_only_cookies'    => true,
                            'use_trans_sid'       => false,
                            'strict'              => false,
                            'remember_me_seconds' => 0,
                            'name'                => 'MyNameSessionSession',
                            'gc_divisor'          => 1000,
                            'gc_maxlifetime'      => 600,
                            'gc_probability'      => 1,
                            //'save_path'                   => APPLICATION_PATH . '/../tmp', // Not for production
                            ),      

// For Dev (Session No Limit)
$appli['resources']['session']['remember_me_seconds'] = 0;
$appli['resources']['session']['gc_divisor']          = 10;
$appli['resources']['session']['gc_maxlifetime']      = 8600;
$appli['resources']['session']['gc_probability']      = 1;
$appli['resources']['session']['save_path']           = APPLICATION_PATH . '/../tmp';

I hope it will help you, otherwise I'm sorry, i could'nt help you
Good luck :)

doydoy44
  • 5,720
  • 4
  • 29
  • 45