1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
databasesessionhandler.php
См. документацию.
1<?php
2
3namespace Bitrix\Main\Session\Handlers;
4
5use Bitrix\Main\Session\Handlers\Table\UserSessionTable;
6
8{
9 public function __construct(array $options)
10 {
11 $this->readOnly = $options['readOnly'] ?? false; //defined('BX_SECURITY_SESSION_READONLY');
12 }
13
14 public function open($savePath, $sessionName): bool
15 {
16 return true;
17 }
18
19 public function processRead($sessionId): string
20 {
21 $sessionRow = UserSessionTable::getRow([
22 'select' => ['SESSION_DATA'],
23 'filter' => [
24 '=SESSION_ID' => $sessionId
25 ]
26 ]);
27
28 if (isset($sessionRow['SESSION_DATA']))
29 {
30 return base64_decode($sessionRow['SESSION_DATA']);
31 }
32
33 return '';
34 }
35
36 public function processWrite($sessionId, $sessionData): bool
37 {
40 'SESSION_ID' => $sessionId,
41 'TIMESTAMP_X' => new \Bitrix\Main\Type\DateTime(),
42 'SESSION_DATA' => base64_encode($sessionData),
43 ]);
44
45 return $result->isSuccess();
46 }
47
48 protected function lock($sessionId): bool
49 {
50 return UserSessionTable::lock($this->sessionId);
51 }
52
53 protected function unlock($sessionId): bool
54 {
55 return UserSessionTable::unlock($this->sessionId);
56 }
57
58 protected function processDestroy($sessionId): bool
59 {
60 return UserSessionTable::delete($sessionId)->isSuccess();
61 }
62
67 public function gc($maxLifeTime): int
68 {
70
71 return 0;
72 }
73
74 public function updateTimestamp($sessionId, $sessionData): bool
75 {
77 'TIMESTAMP_X' => new \Bitrix\Main\Type\DateTime(),
78 ]);
79
80 return $result->isSuccess();
81 }
82}
static getRow(array $parameters)
Определения datamanager.php:398
static delete($primary)
Определения datamanager.php:1644
static add(array $data)
Определения datamanager.php:877
static update($primary, array $data)
Определения datamanager.php:1256
updateTimestamp($sessionId, $sessionData)
Определения databasesessionhandler.php:74
$options
Определения commerceml2.php:49
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
Определения collection.php:2