docs
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
7#include <Ultralight/RefPtr.h>
8#include <Ultralight/String.h>
9
10namespace 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///
30class 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
#define UExport
Definition Exports.h:22
Interface for all ref-counted objects that will be managed using the RefPtr<> smart pointer.
Definition RefPtr.h:49
Storage for a browsing session (cookies, local storage, etc.).
Definition Session.h:30
virtual String disk_path() const =0
The disk path of this session (only valid for persistent sessions).
virtual String name() const =0
A unique name identifying this session.
virtual uint64_t id() const =0
A unique numeric ID identifying this session.
virtual bool is_persistent() const =0
Whether or not this session is written to disk.
Unicode string container with conversions for UTF-8, UTF-16, and UTF-32.
Definition String.h:31
Root namespace for every public Ultralight type, function, and enumeration.