http://www.icyphoenix.com/viewtopic.php?f=28&t=7932&p=53150#p53150
-----------------------------------
Informpro
Tue 12 Jul, 2011 23:48

Re: AJAX Chat 0.8.3 - Possible?
-----------------------------------
Yeah, I noticed the problem just after ...
Took quite time to understand ! But the problem is easy to see : sid is not re-sent each time.

It took quite time to understand HOW I can do that ... But after watching Matrix, everything is okay :D !

So, there's a lot of file to edit ...
Let's go !

OPEN[code]login_ip.php[/code]
FIND[code]$redirect_url = (!empty($redirect) ? urldecode(str_replace(array('&', ($redirect[0] == '?' ? '?' : ''), PHP_EXT . '&'), array('&', '&', PHP_EXT . '?'), $redirect)) : '');[/code]
[b]BEFORE[/b] ADD[code]if (substr($redirect, 0, 4) == 'chat')
  $redirect_url = $redirect;
else[/code] (this is because there's a problem with the ?redirect param when logging in)

Let's modify the shoutbox itself ...
OPEN[code]chat/lib/template/loggedIn.html[/code]
FIND[code]
	<script src="js/chat.js" type="text/javascript" charset="UTF-8"></script>[/code]
[b]BEFORE[/b] ADD[code]<script type="text/javascript">
  var _sid = "[SID/]";
</script>[/code]

OPEN[code]chat/lib/class/AJAXChat.php[/code]
FIND (line 61)[code]
		$this->_requestVars = array();[/code]
[b]AFTER[/b] ADD[code]
		$this->_requestVars['sid']				= isset($_REQUEST['sid']) ? $_REQUEST['sid'] : null;[/code]

OPEN[code]chat/lib/class/CustomAJAXChat.php[/code]
REPLACE THE WHOLE FILE WITH http://pastebin.com/iC4wjedV

OPEN[code]chat/js/chat.js[/code]
FIND (ligne 119)[code]
		this.ajaxURL				= config['ajaxURL'];[/code]
REPLACE WITH[code]
		if (_sid)
			this.ajaxURL				= config['ajaxURL'] + '&sid=' + _sid;
   else
       this.ajaxURL = config['ajaxURL'];[/code]


What have I done ?

Two things : first, I needed to replace login page with IP's login one (_ip).
Second : I needed to re-send SID each ajax call.
Everything should now work !


