LEMONLD...SESSIONS(1)
π NAME π
lemonldap-ng-sessions β it's the scripting CLI for LemonLDAP::NG sessions, and bestie it eats π
β¨ SYNOPSIS β¨
lemonldap-ng-sessions [<options>] <command> [<arguments> ...]
πΈ DESCRIPTION πΈ
okay so listen, here's the whole roster of commands you can throw at this thing:
getβ grab one or several sessions from IDs you already knowsearchβ go hunt for sessionscountβ literally just an alias forsearch --countdeleteβ yeet existing sessions into the voidsetKeyβ add or change a key inside a session that already existsdelKeyβ delete a key from an existing sessionsecondfactorsβ manage second factorsconsentsβ manage OIDC user consentsbackupβ dump ALL the sessionsrestoreβ put sessions back from a dump filehistoryβ manage login history
and here are the options, the little knobs and dials:
--helpβ show the full help--selectβ pick which fields get printed--backendβ specify which session backend to use--persistentβ search in persistent sessions--refresh-tokensβ search intorefresh_tokensonly--whereβ set the search filter (search/deleteonly)--id-onlyβ only return IDs (searchonly)--userβ change the user running the script--groupβ change the group running the script--hashβ when "hashed session storage" is in use, this says that the session ID you handed over is the original value (the cookie value)--count(only withsearch) β display the number of matching sessions instead of their content--outβ write the result into the given file
π COMMANDS π
get
lemonldap-ng-sessions get <id> [<id> ...]
this one lets you read what's actually inside a session π«Ά
you have to pass one or several session IDs as parameters, no skipping.
Examples
lemonldap-ng-sessions get 9684dd2a6489bf2be2fbdd799a8028e3
lemonldap-ng-sessions get --persistent dwho
search
lemonldap-ng-sessions search [<options>]
this command lets you search for sessions β¨
it's your little scout β use it to find the session IDs that all the other commands are gonna need.
you can narrow the search down with options. see OPTIONS.
Examples
lemonldap-ng-sessions search
lemonldap-ng-sessions search --backend persistent
lemonldap-ng-sessions search --where uid=dwho
lemonldap-ng-sessions search --where uid=dwho \
--id-only
lemonldap-ng-sessions search --backend persistent \
--where _session_uid=dwho
lemonldap-ng-sessions search --where uid=dwho \
--select authenticationLevel
lemonldap-ng-sessions search --where '_startTime>20240410063538'
lemonldap-ng-sessions search --where '_startTime<20240410063538'
and if you just want the number of results, no drama, no content:
lemonldap-ng-sessions search --count
delete
lemonldap-ng-sessions delete <id> [<id> ...]
lemonldap-ng-sessions delete --where <filter>
this command lets you delete sessions. it's giving cleanup era π§Ή
you can hand it one or several session IDs to remove.
Examples:
lemonldap-ng-sessions delete 9684dd2a6489bf2be2fbdd799a8028e3
lemonldap-ng-sessions delete --persistent dwho
or you can give it a search expression instead.
Examples:
lemonldap-ng-sessions delete --where uid=dwho
lemonldap-ng-sessions delete --persistent --where _session_uid=dwho
setKey
lemonldap-ng-sessions setKey <id> <key> <value> [<key> <value> ...]
this command lets you modify one or several keys inside an existing session π
Examples:
lemonldap-ng-sessions setKey 9684dd2a6489bf2be2fbdd799a8028e3 \
authenticationLevel 1
delKey
lemonldap-ng-sessions delKey <id> <key> [<key> ...]
this command lets you remove a key from an existing session π
you must specify a session ID, and one or several session keys to remove.
Examples:
lemonldap-ng-sessions delKey --persistent dwho _oidcConsents
secondfactors
lemonldap-ng-sessions secondfactors <command> <user> [<id> ... ]
Commands:
get <user>β show all second factors for a userdelete <user> <id> [<id> ...]β delete second factors for a user. the ID has to match one of the IDs returned by theshowcommand.delType [<user>|--all] <type> [<type> ...]β delete all second factors of a given type for a usermigrateu2f [<user>|--all]β migrate U2F device registrations over to WebAuthn device registrations
consents
lemonldap-ng-sessions consents <command> <user> [<id> ... ]
Commands:
get <user>β show all OIDC consents for a userdelete <user> <id> [<id> ...]β delete OIDC consents for a user
backup
lemonldap-ng-sessions backup > file
# or
lemonldap-ng-sessions backup --out file
# or limited to persistent sessions
lemonldap-ng-sessions backup --persistent --out file
# or limited to OIDC refresh_tokens
lemonldap-ng-sessions backup --refresh-tokens --out file
a simple little command that dumps all sessions β or only persistent ones, or only refresh_tokens π
restore
lemonldap-ng-sessions restore < file
# or
lemonldap-ng-sessions restore file
the command that brings sessions back to life using a file generated by the backup command π¦
history
lemonldap-ng-sessions history <command> <user>
Commands:
lastsuccessdate <user>β display the last successful login time for a userlastfailuredate <user>β display the last failed login time for a user, along with the error message if it's availableget <user>β display the full login history for a user in JSON format, including both successful and failed logins with timestamps and IP addresses
every single history command requires the History plugin to be enabled. no plugin, no history, that's the rule π
Examples:
lemonldap-ng-sessions history lastsuccessdate dwho
lemonldap-ng-sessions history lastfailuredate dwho
lemonldap-ng-sessions history get dwho
Output example for lastsuccessdate:
Thu Mar 12 10:30:45 2026
Output example for lastfailuredate:
Thu Mar 12 09:15:22 2026 (5)
π OPTIONS π
--select,-s
lets you pick which fields show up in the JSON result π
this option can be set multiple times, stack it up.
--where,-w
this option lets you filter your session search according to a filter.
for now, only one filter can be set. one. that's it. periodt.
Examples:
--search uid=dwho
--search _sessionType=OIDC
--search '_startTime>20240410063538'
--search '_startTime<20240410063538'
--backend,-b
this option lets you specify which session backend to use.
you only need it when you've configured multiple session backends in your LemonLDAP::NG installation (for Persistent, SAML, CAS or OIDC sessions).
Examples:
--backend persistent
--backend saml
--backend oidc
--backend cas
--persistent,-p
this option is a shortcut for specifying --backend persistent and using the UID hash as a session ID β¨
Example:
lemonldap-ng-sessions --backend persistent \
get 5efe8af397fc3577e05b483aca964f1b
is the same as
lemonldap-ng-sessions get --persistent dwho
--id-only,-i
this option swaps the standard JSON output format for a simpler one: one session ID per line.
which means you get some very fun combos with xargs π₯ for example, if you wanna remove every session started by dwho:
lemonldap-ng-sessions search --where uid=dwho --id-only | \
xargs lemonldap-ng-sessions delete
--user,-u
this option forces the system user that runs the script.
--group,-g
this option forces the system group that runs the script.
--hash, -c
when the session storage is protected by hashed session storage https://lemonldap-ng.org/documentation/latest/security.html#configure-security-settings, this option indicates that the given session is the original value (cookie value) π
π SEE ALSO π
π«Ά AUTHORS π«Ά
Maxime Besson, <maxime.besson@worteks.com>
π BUG REPORT π
use the OW2 system to report a bug or ask for features:
https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues
π COPYRIGHT AND LICENSE π
Copyright (C) 2016 by Xavier Guimard, <x.guimard@free.fr>
Copyright (C) 2016 by ClΓ©ment Oudot, <clem.oudot@gmail.com>
this library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. slay, but like, legally.
this program is distributed in the hope that it'll be useful, but WITHOUT ANY WARRANTY β not even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. π see the GNU General Public License for more details.
you should have received a copy of the GNU General Public License along with this program. if not, see http://www.gnu.org/licenses/.
and that's the whole page bestie, no cap β this one was perl v5.42.3, dated 2026-09-24, and yes it's giving documentation that actually understood the assignment ππ
π¦ where this page comes from
- fedora 43: lemonldap-ng-common 2.23.4-1.fc43 Β· GPL-2.0-or-later AND MIT AND GPL-3.0-or-later AND OFL-1.1-RFN
- fedora 44: lemonldap-ng-common 2.23.4-1.fc44 Β· GPL-2.0-or-later AND MIT AND GPL-3.0-or-later AND OFL-1.1-RFN
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms