I'm trying to create an online chat program for my web users to speak to a salesperson live. I use an ajax jquery command to refresh the chat, which is stored in a database. The problem I'm running into is it is losing the session variable that identifies the user on the ajax call, but it only seems to do this to some users. Is there some setting for coldfusion that I'm missing?
Should I have any specific settings set in my CF Administrator?
<cfapplication name="Chat Room"
clientmanagement="Yes"
sessionmanagement="Yes"
sessiontimeout="#CreateTimeSpan(0,1,0,0)#" >
<cfset session.UserID = #new_session.UserID# >
window.onload = function()
{
setInterval("ReloadChatWindow();", 2500);
};
function ReloadChatWindow()
{
$.ajax({url: "messages.cfm", success: function(result){
$("#ChatLog").html(result);
}});
$("#ChatLog").scrollTop($("#ChatLog")[0].scrollHeight);
}
new_session.UserID# is just from a database insert (the user provides their name and I assign them the userID.
Only one domain uses the session, there are no cross domain calls.
new_session.UserIDand why bother setting a new session scope? - TRoseSERVER SETTINGS>Memory Variables- rrk<cfapplication...>in a regular file? - Mark A Kruger