docs
Docs
C++ API
C API
Search API
Ctrl K
2.0
2.0
latest
1.4
Ultralight C++ API
2.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
Session.h
Go to the documentation of this file.
1
///
2
/// Copyright (C) 2026 Ultralight, Inc. All rights reserved.
3
/// A license is required for commercial use. https://ultralig.ht
4
///
5
#pragma once
6
#include <
Ultralight/Defines.h
>
7
#include <
Ultralight/RefPtr.h
>
8
#include <
Ultralight/String.h
>
9
10
namespace
ultralight
{
11
12
///
13
/// Storage for a browsing session (cookies, local storage, etc.).
14
///
15
/// This class stores data for a unique browsing session (cookies, local storage, application cache,
16
/// indexed db. etc.). You can create multiple sessions to isolate data between different browsing
17
/// contexts.
18
///
19
/// ## Default Session
20
///
21
/// The Renderer has a default session named "default" that is used if no session is specified when
22
/// when creating a View.
23
///
24
/// ## Session Lifetime
25
///
26
/// Sessions can be either temporary (in-memory only) or persistent (backed to disk).
27
///
28
/// @see Renderer::CreateSession
29
///
30
class
UExport
Session
:
public
RefCounted
{
31
public
:
32
///
33
/// Whether or not this session is written to disk.
34
///
35
virtual
bool
is_persistent
()
const
= 0;
36
37
///
38
/// A unique name identifying this session.
39
///
40
virtual
String
name
()
const
= 0;
41
42
///
43
/// A unique numeric ID identifying this session.
44
///
45
virtual
uint64_t
id
()
const
= 0;
46
47
///
48
/// The disk path of this session (only valid for persistent sessions).
49
///
50
virtual
String
disk_path
()
const
= 0;
51
52
protected
:
53
virtual
~Session
();
54
};
55
56
}
// namespace ultralight
UExport
#define UExport
Definition
Exports.h:22
RefPtr.h
String.h
Defines.h
ultralight::RefCounted
Interface for all ref-counted objects that will be managed using the RefPtr<> smart pointer.
Definition
RefPtr.h:49
ultralight::Session
Storage for a browsing session (cookies, local storage, etc.).
Definition
Session.h:30
ultralight::Session::disk_path
virtual String disk_path() const =0
The disk path of this session (only valid for persistent sessions).
ultralight::Session::~Session
virtual ~Session()
ultralight::Session::name
virtual String name() const =0
A unique name identifying this session.
ultralight::Session::id
virtual uint64_t id() const =0
A unique numeric ID identifying this session.
ultralight::Session::is_persistent
virtual bool is_persistent() const =0
Whether or not this session is written to disk.
ultralight::String
Unicode string container with conversions for UTF-8, UTF-16, and UTF-32.
Definition
String.h:31
ultralight
Root namespace for every public Ultralight type, function, and enumeration.
Ultralight
Session.h
Docs
C++ API
C API
Version
2.0
2.0
latest
1.4