  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: session.php 1667 2007-07-19 20:42:39Z hpdl $ |
| |
| 3 | + | $Id: session.php 1668 2007-07-20 14:53:24Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
72 | 72 | | |
| |
73 | 73 | | public function __construct($name = null) { |
| |
74 | 74 | | $this->setName($name); |
  |
75 | | - | $this->_setCookieParameters(); |
| |
| 75 | + | $this->_setCookieParameters(SERVICE_SESSION_EXPIRATION_TIME); |
| |
| 76 | + | |
| |
| 77 | + | if ( SERVICE_SESSION_EXPIRATION_TIME > 0 ) { |
| |
| 78 | + | ini_set('session.gc_maxlifetime', SERVICE_SESSION_EXPIRATION_TIME * 60); |
| |
| 79 | + | } |
|
76 | 80 | | } |
| |
77 | 81 | | |
| |
78 | 82 | | /** |
| |
|
|
 |
… |
|
284 | 288 | | protected function _setCookieParameters($lifetime = 0, $path = null, $domain = null, $secure = false, $httponly = false) { |
| |
285 | 289 | | global $request_type; |
| |
286 | 290 | | |
  |
| 291 | + | if ( !is_numeric($lifetime) ) { |
| |
| 292 | + | $lifetime = 0; |
| |
| 293 | + | } |
| |
| 294 | + | |
  |
287 | 295 | | if ( empty($path) ) { |
| |
288 | 296 | | $path = (($request_type == 'NONSSL') ? HTTP_COOKIE_PATH : HTTPS_COOKIE_PATH); |
| |
289 | 297 | | } |