View Complete Thread | FoxWeb Forum Home
Date:    Msg ID:   
From:    Thread:   
The variable name in the SetVar and GetVar methods must be passed as a string.  If you want your variable to be called pUserID then you must use Session.SetVar('pUserID', pUser) to store your value and Session.GetVar('pUserID') to retrieve it.

FoxWeb Support Team email

Sent by Joe Goldsmith on 05/31/2002 11:04:15 PM:

Hello. I am having a hard problem setting a variable so I can capture it later and query a table. Here is the code using FoxWeb authenicate code to log in the user:


      CASE Auth.NewLogin
       IF USED('clients')
        SELECT clients
       USE pbs!clients IN 0
       LOCATE FOR clients.userID = Auth.UserID
       pUser = ""
       pUserID = ""
       pUser = clients.clientid && unique client ID
       Session.SetVar(pUserID,pUser) && save unique id to var pUserID


lcClientID = Session.GetVar(pUserID) && Error Here - Can't find var pUserID
USE c:\inetpub\wwwroot\data\pbs!vClientProfile NODATA SHARED IN 0  && local view
SELECT vClientProfile  && Select view
vClientID = lcClientID  && set value for parameratized view
=REQUERY()  && fetch record

What am I doing wrong setting and getting a session variable?