Forum QuickConnect Log out

Discussion and help relating to PlayerIO's QuickConnect feature, including Facebook Connect and Kongregate Connect.

Log out

Postby wgfunstorm » September 15th, 2012, 12:39 am

Seems like such a simple thing but I don't see it covered in the docs or forum anywhere:

How do I log players out? Say I have a player who has signed in either using PlayerIO.connect() or PlayerIO.quickConnect.simpleConnect(), how do I log them out such that they can log in with a different username?

I know of myConnection.disconnect() but that seems to be for disconnecting players from rooms, and I want them to log out completely so they can change user. Right now I'm just doing myClient = null, and then calling connect/simpleconnect again but I'm not sure if this is correct... am I leaving the previous connection open by doing that?
wgfunstorm
 
Posts: 16
Joined: January 21st, 2012, 4:10 pm

Re: Log out

Postby Henrik » September 15th, 2012, 12:46 pm

You don't, you can have as many connected clients with as many different usernames as you want, at any single time. Just throw away the client you don't want and Connect a new one.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Log out

Postby Benjaminsen » September 15th, 2012, 6:17 pm

As Henrik says, logging out is as simple as disposing of the client object. Player.IO webservice connections does not rely on a cookie, thus the session is automatically lost.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark


Return to QuickConnect



cron