I've got a simple component that I'm instantiating to maintain a persistent
variable. Basically, the CFC checks for new entries in a table, and if there
are any, sets this variable to be the last entry's id. The next time the CFC is
called, it will check for new entries using this variable as the starting
point.This works perfectly in Firefox, but not IE or Safari. It appears as
though the variable is never set/stored, and remains at 0. I'm not sure what
I'm missing, but I can't find any documentation about why a CFC might behave
differently in different browsers. What am I missing???
I am instantiating the CFC into a session, using an init() method like so:
<cfset session.customerChat =
createObject("component","msg").init(chatSession.session)>
My CFC consists of two mehtods only:
<cffunction name="init" access="public" output="no" returntype="msg">
<cfargument name="sid" type="numeric" required="yes">
<cfset Variables.ssid = arguments.sid>
<cfset Variables.lastid = 0>
<cfreturn this>
</cffunction>
<cffunction name="getAllMessages" returntype="query" hint="gets all
messages in chat session">
<cfquery name="rsGetAllMsg" datasource="#variables.dsn#">
SELECT
cm.s_id,m_id,message,mtime,cm.o_id,cm.c_id,o_name,c_name,c_question
FROM chat_messages cm
LEFT OUTER JOIN chat_operators co
ON co.o_id = cm.o_id
LEFT OUTER JOIN chat_customers cc
ON cc.c_id = cm.c_id
WHERE cm.s_id = #Variables.ssid#
AND m_id > #Variables.lastid#
</cfquery>
<cfif rsGetAllMsg.recordcount neq 0>
<cfquery name="getlastid" dbtype="query">
SELECT max(m_id) as maxid
FROM rsGetAllMsg
</cfquery>
<cfset Variables.lastid = getlastid.maxid>
</cfif>
<cfreturn rsGetAllMsg>
</cffunction>
I would appreciate any help.
Thanks,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309341
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4