[APE Project] Ape Session Handling?

131 views
Skip to first unread message

Costel

unread,
May 10, 2010, 5:39:22 AM5/10/10
to APE Project
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 ape-p...@googlegroups.com
To unsubscribe from this group, send email to
ape-project...@googlegroups.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/

Manas B

unread,
May 10, 2010, 9:21:43 AM5/10/10
to APE Project
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 <costel.iul...@gmail.com> 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 ape-p...@googlegroups.com
> To unsubscribe from this group, send email to
> ape-project...@googlegroups.com
> For more options, visit this group athttp://groups.google.com/group/ape-project?hl=en

Costel

unread,
May 10, 2010, 10:33:07 AM5/10/10
to APE Project
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

Manas B

unread,
May 10, 2010, 1:15:01 PM5/10/10
to APE Project
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.

Patrick Schwering

unread,
May 10, 2010, 1:21:39 PM5/10/10
to ape-p...@googlegroups.com
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 <m4m...@gmail.com>

Costel

unread,
May 10, 2010, 4:22:49 PM5/10/10
to APE Project
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>
> > > > > 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 ape-p...@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > ape-project...@googlegroups.com<ape-project%2Bunsubscribe@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 ape-p...@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > ape-project...@googlegroups.com<ape-project%2Bunsubscribe@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 ape-p...@googlegroups.com
> > To unsubscribe from this group, send email to
> > ape-project...@googlegroups.com<ape-project%2Bunsubscribe@googlegr oups.com>
Reply all
Reply to author
Forward
0 new messages