Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

AFCS session related questions

Avatar

Level 2

Hello

I started using AFCS recently so please forgive me if I will ask some silly questions.

First of all let me congratulate you. This functionality is really cool. I went through few examples and I am planning to build a chat application using external authentication (PHP). Sample application you have included works perfect but I have few questions:

1)      What is the lifespan of session? I am planning to build application for internal purposes (chat between support staff) in our portal. I would like users to be able to reconnect to chat at any time and start new/continue previously started conversations. It is working like that but I would not like users to see messages older then let’s say 2-4 hours. How can I control session lifespan? Can you tell me where I can find some more documentation/examples regarding controlling sessions?

2)      When I am logging in using same user name for the second time system is adding suffix (incremented value) after my name rather than overwriting existing user. I understand necessity of such functionality for public chats where people might login using pretty much any name but in my case user names are unique (each user in our portal has a unique name) so there is no need for such functionality. I know that probably logging out would solve the issue but I can’t force users to do that. Is there a way to prevent getting multiple instances of same user name with suffixes?

Kind Regards

Michael

0 Replies

Avatar

Level 3

if you are using external authentication (PHP) to control login/logout, Can you do (#2) using the authentication?

BaBo,

Avatar

Level 10

Hi Michael,

1) A session typically lives for up to 5 minutes after the last person connected leaves. If you make your chat pod "sessionDependent", it will clean itself up automatically once the session dies. Otherwise, you can have someone who logs in as an OWNER clear the chat as well. Soon, we're going to be offering HTTP/AMF APIs which will make it possible to do this from your server.

2) If you're getting multiple users w/ suffixes, are there users who are connected twice? This is usually the reason for this problem. If you want to remove the suffix, you can have the user call userManager.setUserDisplayName, once they're in, which won't do any suffixing.

hope that helps

nigel

Avatar

Level 2

Hi Nigel

1) I will play around with it more. Thanks for all the info. Is there some detail documentation about sessions in AFCS?

2) Yes, this behaviour is caused by users logging in more than once but only because they might forget to log out. I would not like system to create another user ID for them (adding suffix to the name) when they are logging in second (or third) time around. I could probably try and alter table of logged users but I don’t like this approach. I think that there should be an attribute that developers could set that would order system to renew (replace) session for John Smith or create a new session adding suffix to user name. As explained before there are 2 scenarios to consider. First is a public chat where we can have multiple John Smiths logging in. It is only logical that each one of them will have assigned some suffix to make their user name unique. Second scenario is internal use application where all users have unique names to start with. Problem is that some of them will not log out from application (they will just close the window). They might come back to chat in few minutes time and I would like them to have user ID without any suffix as there is only one John Smith in the system. I hope I described this issue clear enough.

Regards

Michael