Best practice to deal with "session variables"

Hello,

with Allow persistent session variables option set off
I can see SPARQLUserId:

http(concat('connection_vars: ', serialize(connection_vars()), '<br/>')); 
http(concat('user id: ', connection_get('SPARQLUserId'), '<br/>')); 
http(concat('sid: ', connection_get('sid'), '<br/>'));
connection_vars: ���SPARQLUserId�dba
user id: dba
sid:

With “Allow persistent session variables” option set on
I can see sid only:
gkrellShoot_04-07-24_214220

connection_vars: ���sid�
user id:
sid: 0

And VS_SID at DB.DBA.VSPX_SESSION table.
"virtuoso_admi 5b952..... dba"

However, as you can see “VS_SID” is not = 0;

Questions:

1
How to get “VS_SID” for a given “sid” ?

2
https://docs.openlinksw.com/virtuoso/fn_connection_vars/
“Connection variables do not persist across sessions”.

I see connection_vars() persist during “connection” only. Not even during a single session.

That’s the best practice to deal with “session variables” ?

@MakeItWork

Please take a look at session management in web applications tutorial examples.

HTH

1 Like

On the second day, Keen Eye had see http_request_header().

Thank you.