summaryrefslogtreecommitdiff
path: root/core/classes/session/DefaultSession.php
blob: 5e7ce390a872782a1a6f7e2cd5791cc416c5e103 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php

/** DefauleSession
 * --
 * 
 * is a dummy session hanlder that wraps the
 * php's default session engine implementation;
 * 
 */
class DefaultSession implements SessionHandlerInterface {

    public function __construct()
    {
        // Start the session
        // (the default way)
        // and let the session* functions 
        // do what they know
        ini_set( "session.gc_maxlifetime", MAX_SESSION_LIFE );
        session_set_cookie_params([
            'path' => '/',
            // 'domain' => COOKIE_DOMAIN,   # on localhost must be omitted entirely
            'secure' => COOKIE_SECURE,
            'samesite' => COOKIE_SAMESITE
        ]);
        session_name(SESSION_NAME);
        session_start();
    }

    #[\ReturnTypeWillChange]
    public function open(string $path, string $name) {}

    #[ReturnTypeWillChange]
    public function close() {}

    #[ReturnTypeWillChange]
    public function read(string $id) {
        
    }

    #[ReturnTypeWillChange]
    public function write(string $id, string $data) {}

    #[ReturnTypeWillChange]
    public function destroy(string $id) {}

    #[ReturnTypeWillChange]
    public function gc(int $max_lifetime) {}

}