>How do you span sessions across ColdFusion servers if you aren't using
 Enterprise?

I've never done this in CF but have in ASP.  In the earlier days of the web
the mandate for places I worked was never use session variables.  So I have
always coded without using them.  There was always someone who wanted to
stuff every thing they could in there so we developed a begintran and
endtran function that would loop through the session and create a cookie. 
This would also allow for the user to be sticky. 

Essentially something like this, although this is ASP

Function Begin_Tran()
        strCookies = Request.Cookies("foo")
        Response.Cookies("foo") = ""
        
        startPos = 1
        tildePos = InStr(startPos, strCookies, "~")
        Do While InStr(startPos, strCookies, "~")
                caratPos = InStr(startPos,strCookies,"^")
                tildePos = InStr(startPos,strCookies,"~")
                varName = Mid(strCookies,startPos,caratPos - startPos)
                varValue = Mid(strCookies,caratPos + 1,tildePos - caratPos -
1)
                startPos = tildePos + 1
                Session(varName) = varValue
        Loop
End Function

Function end_tran()
        Dim strCookies, objItem, strValue

        For Each objItem in Session.Contents
                strValue =
Replace(Replace(Session.Contents(objItem),"~",""),"^","")
                strCookies = strCookies & objItem & "^" & strValue & "~"
        Next
                

        Response.Cookies("foo") = strCookies 
        Response.Cookies("foo").Path = "/"
        Session.Contents.RemoveAll
End Function

-----Original Message-----
From: Dawson, Michael [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 23, 2005 2:56 PM
To: CF-Talk
Subject: RE: Pros/Cons Session vs Client scope

>How do you span sessions across ColdFusion servers if you aren't using
Enterprise?

More-knowledgeable people will need to answer this one.

>Why would you even put CFC's into a session scope? Shouldn't they be in
the application scope?

When a user logs in to your site, you can create a session-based CFC.
That CFC will hold personal information for that user.  Session-based
CFCs are great for any system that requires a login.

M!ke



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225118
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to