Session managenet
Posted: Tue Apr 21, 2015 9:18 am
Roger,
in CXP is nice feature: automatic session management:
- auto-creating memory variable if it not yet exists and assigning value into it
- auto assigning NIL to all ::Session variables after Session TimeOut event occurs
I just convert next CXP code to CxpHttpServer, and I am not sure,
what will be the best way how do this things.
This feature is so powerfull, because with simple compare value for NIL
I can test, if user/session is still active/ready,
and if not, he must re-login again,
and also before (re-)login I clear/delete eventually all previously records
in some temporally dbf file(-s)
// e.g.:
<%
If ::Session:CustomerName == NIL
// inicialize all variables to default values...
::Session:cPredNazov := ''
::Session:nCennik := 0
::Session:aKosik := {}
::Session:lKosik := .F.
......
EndIf
%>
Is this already or will be something similar in CxpHttpServer too?
Or is it any other way for do the same things like it does?
TIA & Regards
Zdeno
in CXP is nice feature: automatic session management:
- auto-creating memory variable if it not yet exists and assigning value into it
- auto assigning NIL to all ::Session variables after Session TimeOut event occurs
I just convert next CXP code to CxpHttpServer, and I am not sure,
what will be the best way how do this things.
This feature is so powerfull, because with simple compare value for NIL
I can test, if user/session is still active/ready,
and if not, he must re-login again,
and also before (re-)login I clear/delete eventually all previously records
in some temporally dbf file(-s)
// e.g.:
<%
If ::Session:CustomerName == NIL
// inicialize all variables to default values...
::Session:cPredNazov := ''
::Session:nCennik := 0
::Session:aKosik := {}
::Session:lKosik := .F.
......
EndIf
%>
Is this already or will be something similar in CxpHttpServer too?
Or is it any other way for do the same things like it does?
TIA & Regards
Zdeno