I am trying to store a value in the ASP Session object for use in persisting state. I dont seem to be able to get it to work. I am using html frames where the visit function is accessable through include files. Cookies are enabled in my browser and I set IIS to have sessions last 20 min. This is the ASP code
Function visit
IF IsEmpty(m_visit) Then
Set m_visit = Server.CreateObject("progid.object")
m_visit.configure g_sitename, g_domainname, g_SQLConnect, g_AppDir, Session
END IF
SET visit = m_visit
End Function
This is the VFP code where I find that the value is not persisted.
Parameters cSiteName, cMailDomain, cDBString, cAppDir , oSession
If DIRECTORY(cAppDir)
SET PATH TO (cAppDir)
With THIS
SET EXCL OFF
.cSiteName = cSiteName
.cMailDomain = cMailDomain
.cDBString = cDBString
.cAppDir = cAppDir
.oSession = oSession
IF NOT ISNULL(.oSession)
.iCartID = .oSession.Value("iCartID")
.iCartID = INT(VAL(.iCartID))
ENDIF
.GetCart()
ENDIF
This is the code where I get a new cart if one does not exist already
LOCAL ;
loRS,;
lcConnStr
WITH THIS
IF .iCartID = 0
lcSQL = "table"
lcConnStr = .GetDBString()
loRS = CreateObject("ADODB.RecordSet")
' just getting an id using SQL Server identity....
WITH loRS
.Open(lcSQL,lcConnStr,adOpenKeySet,adLockOptimistic)
.AddNew()
.Update()
THIS.iCartID = .Fields("iCartID").Value
THIS.oSession.Value("iCartID")= This.iCartID
.Close()
ENDWITH
ENDIF
ENDWITH
Terry Rooks
Software Systems Architect
Microsoft Certified Solution Developer.Net
If at first you don't succeed, then skydiving definitely isn't for you.