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
<[email protected]> 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 <[email protected]>
>
>
>
>
>
> > client.core.clearSession()
>
> > This will clear the session. This is part of the ape.Core.Session.js
>
> > May be you can post your code here. That will help other community
> > member to reach out to you.
>
> > On May 10, 7:33 pm, Costel <[email protected]> wrote:
> > > That's what I want to do but there is no documentation about session
> > > handling on the server side.
>
> > > I need this when a user logs out from my php app.
> > > For now... if a user log out and then log in on a different account
> > > (for php), the APE session remains the same, wich is wrong.
> > > I could force the ape cookie deletion on php logout routine but I
> > > don't want to do this.
>
> > > Thanks in advance and please excuse my english :-p
>
> > > On May 10, 4:21 pm, Manas B <[email protected]> wrote:
>
> > > > Why not write a server side module which can destroy session. Delete
> > > > the session data of the server and inform that the client had
> > > > disconnected. I m just doing a loud thinking. Still have to get into
> > > > the deep of session.
>
> > > > On May 10, 2:39 pm, Costel <[email protected]> wrote:
>
> > > > > I'm wondering how to destroy a session on server side... ? Does
> > anyone
> > > > > knows?
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > > > Groups "APE Project" group.
> > > > > To post to this group, send email to [email protected]
> > > > > To unsubscribe from this group, send email to
> > > > > [email protected]<ape-project%2bunsubscr...@googlegr
> > > > > oups.com>
> > > > > For more options, visit this group athttp://
> > groups.google.com/group/ape-project?hl=en
> > > > > ---
> > > > > APE Project (Ajax Push Engine)
> > > > > Official website :http://www.ape-project.org/
> > > > > Git Hub :http://github.com/APE-Project/
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > > > Groups "APE Project" group.
> > > > To post to this group, send email to [email protected]
> > > > To unsubscribe from this group, send email to
> > > > [email protected]<ape-project%2bunsubscr...@googlegr
> > > > oups.com>
> > > > For more options, visit this group athttp://
> > groups.google.com/group/ape-project?hl=en
> > > > ---
> > > > APE Project (Ajax Push Engine)
> > > > Official website :http://www.ape-project.org/
> > > > Git Hub :http://github.com/APE-Project/
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "APE Project" group.
> > > To post to this group, send email to [email protected]
> > > To unsubscribe from this group, send email to
> > > [email protected]<ape-project%2bunsubscr...@googlegr
> > > oups.com>
> > > For more options, visit this group athttp://
> > groups.google.com/group/ape-project?hl=en
> > > ---
> > > APE Project (Ajax Push Engine)
> > > Official website :http://www.ape-project.org/
> > > Git Hub :http://github.com/APE-Project/
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "APE Project" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<ape-project%2bunsubscr...@googlegr
> > oups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/ape-project?hl=en
> > ---
> > APE Project (Ajax Push Engine)
> > Official website :http://www.ape-project.org/
> > Git Hub :http://github.com/APE-Project/
>
> --
> You received this message because you are subscribed to the Google
> Groups "APE Project" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group
> athttp://groups.google.com/group/ape-project?hl=en
> ---
> APE Project (Ajax Push Engine)
> Official website :http://www.ape-project.org/
> Git Hub :http://github.com/APE-Project/
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/