OPNsense Forum

Archive => 18.1 Legacy Series => Topic started by: itchy2 on June 12, 2018, 07:32:10 pm

Title: Captive Portal: Sessions - how to read session id in Logfiles
Post by: itchy2 on June 12, 2018, 07:32:10 pm
Hi all,

I'm trying to analyze an issue (not sure if it is the device or the opnsense, expect the device to be the problem) and not i'm struggeling a little bit to "read" the session IDs of my Captive Portal.

In the Logfile I can find entries like:

captiveportal: session Myj4rkqH[removed by author]9S11w== hit idletimeout
captiveportal: remove concurrent session lTALy[removed by author]3Zv7+ug==
captiveportal: session G0K+5K[removed by author]RQ== hit idletimeout

but how can I translate / lookup those cryptic session IDs?

Thx and KR
Itchy2
Title: Re: Captive Portal: Sessions - how to read session id in Logfiles
Post by: fabian on June 12, 2018, 07:52:50 pm
everything related to the captive portal is stored in a SQLite DB.
Title: Re: Captive Portal: Sessions - how to read session id in Logfiles
Post by: itchy2 on June 12, 2018, 09:35:06 pm
ok. Sounds interesting. Do you know where the file is located? So I can check out if it helps to understand the session ids. But shouldn't it be visible somewhere in the logfiles / frontend also?

Thx and KR
Itchy2
Title: Re: Captive Portal: Sessions - how to read session id in Logfiles
Post by: fvanroie on June 12, 2018, 10:13:43 pm
The SQLite database is located here (https://github.com/opnsense/core/blob/master/src/opnsense/scripts/OPNsense/CaptivePortal/process_accounting_messages.php):

Code: [Select]
$database_filename = '/var/captiveportal/captiveportal.sqlite';
You can also make the SessionId visible in Services > Captive Portal > Sessions
Then click the column drop-down list -right to the search field- to enable Session. The list will now show the SessionId information in the Web GUI.
Title: Re: Captive Portal: Sessions - how to read session id in Logfiles
Post by: itchy2 on June 14, 2018, 08:51:41 pm
Thanks a lot. Thats very helpful. I was a little bit disappointed by checking the database. Only current valid information are stored. Nothing historic.

Thx and KR
Itchy2