The problem is that SetSessionVar() checks for EMPTY(lcValue) and .F. translates to empty as does 0.
which should avoid this problem.
FWIW, SetSessionVar() accepts values of any type, but when you use GetSessionVar() you only get back a string. Session effectively works only with string values so on the out end you're responsible for converting back to whatever type you had to start with.
VFP Version: 8 Wconnect Version 5.63
I am attempting to store a variable into the wsession table. Code below:
session.setSessionvar('admin',this.oUSERSECURITY.oUser.Admin)
This does not record the variable in the wsession table. However, a numeric value is stored see code below:
session.setSessionvar('logoncount',this.oUSERSECURITY.oUser.logoncount)
Am I to assume that logical values must be converted before storing them in the session table?
From the SetSesionVar function there is a check done on the the value ... if empty(lcvalue) ... lcvalue is recorded with "". When a numeric value is passed ... all seems to work well ...
Debug screen shows the test for empty(lcvalue) as .T. and then store "" into lcvalue. As a result of this the variable is not stored with the session
<span style="{font-size: xx-small; color: red;}">Code parsing for language: "'VFP" is not currently supported.<br></span>
FUNCTION SetSessionVar
LPARAMETERS lcVarName, lcValue
LOCAL lctext, lcValue, lcOldAlias, loData
lcVarName = lower(lcVarname)
loData = THIS.oData
IF EMPTY(lcValue)
lcValue = ""
ENDIF