Completed
Branch master (c520c0)
by Filipe
01:29
created

ServerDriver::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 1
1
<?php
2
3
/**
4
 * This file is part of slick/http
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Slick\Http\Session\Driver;
11
12
use Slick\Http\Session\SessionDriverInterface;
13
14
/**
15
 * ServerDriver
16
 *
17
 * @package Slick\Http\Session\Driver
18
*/
19
class ServerDriver extends AbstractDriver implements SessionDriverInterface
20
{
21
22
    /**
23
     * Creates a Server Session Driver
24
     *
25
     * @param array $options
26
     */
27
    public function __construct(array $options = [])
28
    {
29
        parent::__construct($options);
30
31
        session_set_cookie_params($this->lifetime, '/', $this->domain);
32
        session_name($this->name);
33
        if (session_status() !== PHP_SESSION_ACTIVE) {
34
            session_start();
35
        }
36
    }
37
}