Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: SetSessionVar Not Storing Logical Values

$
0
0
Re: SetSessionVar Not Storing Logical Values
Web Connection 5.0
Re: SetSessionVar Not Storing Logical Values
Feb. 27, 2013
01:06 pm
3Q50S3EA4Show this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Roy M
Roy,

The problem is that SetSessionVar() checks for EMPTY(lcValue) and .F. translates to empty as does 0.

I've changed the code:

IFPCOUNT() < 2 lcValue = ""ENDIF

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.

+++ Rick ---


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   



Rick Strahl
West Wind Technologies


from Maui, Hawaii

Making waves on the Web


Viewing all articles
Browse latest Browse all 10393

Trending Articles