Err, missed this post, sorry.
The AJAX chat software detects the presence of an established SMF session, then sets its own. This means that any login process actually has to go through SMF, not AJAX, and be able to support both sets of cookies to maintain session status.
As I mentioned in PM, a much better solution would be to construct a responsive layout for Blueimp's AJAX Chat. There is nothing you can do with it in an app that you can't do with responsive design, and at least in the latter case all of the relevant client code is already written, and doesn't require members to input passwords anywhere they haven't been already.