docs
Docs
C++ API
C API
Search API
Ctrl K
1.4
2.0
latest
1.4
Ultralight C API
1.4.0
Toggle main menu visibility
Loading...
Searching...
No Matches
CAPI_Session.h
Go to the documentation of this file.
1
/**************************************************************************************************
2
* This file is a part of Ultralight. *
3
* *
4
* See <https://ultralig.ht> for licensing and more. *
5
* *
6
* (C) 2024 Ultralight, Inc. *
7
**************************************************************************************************/
8
9
///
10
/// @file CAPI_Session.h
11
///
12
/// Storage for a browsing session (cookies, local storage, etc.).
13
///
14
/// `#include <Ultralight/CAPI/CAPI_Session.h>`
15
///
16
/// This class stores data for a unique browsing session (cookies, local storage, application cache,
17
/// indexed db. etc.). You can create multiple sessions to isolate data between different browsing
18
/// contexts.
19
///
20
/// ## Default Session
21
///
22
/// The library has a default session named "default" that is used if no session is specified when
23
/// when creating a View.
24
///
25
/// ## Session Lifetime
26
///
27
/// Sessions can be either temporary (in-memory only) or persistent (backed to disk).
28
///
29
#ifndef ULTRALIGHT_CAPI_SESSION_H
30
#define ULTRALIGHT_CAPI_SESSION_H
31
32
#include <
Ultralight/CAPI/CAPI_Defines.h
>
33
34
#ifdef __cplusplus
35
extern
"C"
{
36
#endif
37
38
/******************************************************************************
39
* Session
40
*****************************************************************************/
41
42
///
43
/// Create a Session to store local data in (such as cookies, local storage, application cache,
44
/// indexed db, etc).
45
///
46
ULExport
ULSession
ulCreateSession
(
ULRenderer
renderer,
bool
is_persistent,
ULString
name);
47
48
///
49
/// Destroy a Session.
50
///
51
ULExport
void
ulDestroySession
(
ULSession
session);
52
53
///
54
/// Get the default session (persistent session named "default").
55
///
56
/// @note This session is owned by the Renderer, you shouldn't destroy it.
57
///
58
ULExport
ULSession
ulDefaultSession
(
ULRenderer
renderer);
59
60
///
61
/// Whether or not is persistent (backed to disk).
62
///
63
ULExport
bool
ulSessionIsPersistent
(
ULSession
session);
64
65
///
66
/// Unique name identifying the session (used for unique disk path).
67
///
68
ULExport
ULString
ulSessionGetName
(
ULSession
session);
69
70
///
71
/// Unique numeric Id for the session.
72
///
73
ULExport
unsigned
long
long
ulSessionGetId
(
ULSession
session);
74
75
///
76
/// The disk path to write to (used by persistent sessions only).
77
///
78
ULExport
ULString
ulSessionGetDiskPath
(
ULSession
session);
79
80
#ifdef __cplusplus
81
}
// extern "C"
82
#endif
83
84
#endif
// ULTRALIGHT_CAPI_SESSION_H
CAPI_Defines.h
Various defines and utility functions for the C API.
ULString
struct C_String * ULString
Definition
CAPI_Defines.h:65
ULSession
struct C_Session * ULSession
Definition
CAPI_Defines.h:61
ULExport
#define ULExport
Definition
CAPI_Defines.h:38
ULRenderer
struct C_Renderer * ULRenderer
Definition
CAPI_Defines.h:60
ulSessionIsPersistent
bool ulSessionIsPersistent(ULSession session)
Whether or not is persistent (backed to disk).
ulSessionGetId
unsigned long long ulSessionGetId(ULSession session)
Unique numeric Id for the session.
ulDestroySession
void ulDestroySession(ULSession session)
Destroy a Session.
ulDefaultSession
ULSession ulDefaultSession(ULRenderer renderer)
Get the default session (persistent session named "default").
ulSessionGetDiskPath
ULString ulSessionGetDiskPath(ULSession session)
The disk path to write to (used by persistent sessions only).
ulCreateSession
ULSession ulCreateSession(ULRenderer renderer, bool is_persistent, ULString name)
Create a Session to store local data in (such as cookies, local storage, application cache,...
ulSessionGetName
ULString ulSessionGetName(ULSession session)
Unique name identifying the session (used for unique disk path).
Ultralight
CAPI
CAPI_Session.h
Docs
C++ API
C API
Version
1.4
2.0
latest
1.4