I will explain here what is all about:
I'm using a hook on CONNECT to verify the user.
The login procedure looks like this:
//CLIENT SIDE:
client.core.start({"PHPSESSID":phpSID});
//where phpSID is the php session id
//SERVER SIDE:
Ape.registerHookCmd("CONNECT", function(params, cmd) {
params.user = cmd.user.getProperty("pubid");
params.cmd = 'login';
http_auth("
http://login_url/", params, function(result) {
if (result.logged == 1) {
cmd.user.user_id =
result.user_id;
Ape.log('The user'+cmd.user.user_id+' was
registered');
}
else
{
cmd.sendResponse("FAIL", {"you":"fail"});
}
});
return -1;
});
The "
http://login_url" is where the phpSID is verified. If the user is
logged in, it returns a json encoded object with the logged parameter
set to 1 else 0.
On a normal php or jsp web app, when a user wants to logout he would
normally press a logout button wich will destroy all data stored to
that session.
So in my case I want to destroy both php and APE sessions on the
server side and when the next CHECK command will occur, the server
would respond with a BAD_SESSID and then on another login i would call
client.core.start again.
Thanks again. If I'am not gonna make it then i'll use
setcookie('APE_Cookie'.....) (with expire time) to clear that ape
cookie.
On May 10, 8:21 pm, Patrick Schwering
<
patrick.schwer...@googlemail.com> wrote:
> I think he want to write a simple logout function which leave all ape
> channels.
> So the Nickname can be used at the next time again.
>
> 2010/5/10 Manas B <
m4ma...@gmail.com>
> > > > >
ape-project...@googlegroups.com<ape-project%2Bunsubscribe@googlegr
oups.com>
> > > >
ape-project...@googlegroups.com<ape-project%2Bunsubscribe@googlegr
oups.com>
> > >
ape-project...@googlegroups.com<ape-project%2Bunsubscribe@googlegr
oups.com>
> >
ape-project...@googlegroups.com<ape-project%2Bunsubscribe@googlegr
oups.com>