Session Tokens and ...
 
Notifications
Clear all

Session Tokens and Sessions

9 Posts
2 Users
0 Reactions
798 Views
(@megaman)
Posts: 34
Trusted Member
Topic starter
 

Dear, Skared Creations.

Session Tokens and Sessions are growing fast... Is it a good practice to clear session Tokens and Sessions at all? How can i delete all previous session Tokens and Sessions on user login? Or maybe there is a better options? 

Combu 3.0 beta 5

Thanks a lot!

 
Posted : 27/02/2017 9:20 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

That shouldn't be an issue unless you have a space limit for the database since the records are loaded by Token that is primary key (so the access should be very fast even if you have many records), anyway I will add a page in the web admin to eventually delete older sessions and tokens so you can run it whenever you want. I will also remove the auto-increment field Id from the table Session and make IdAccount+GUID as primary key so we can safely get rid of the Id.

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 27/02/2017 9:52 pm
(@megaman)
Posts: 34
Trusted Member
Topic starter
 

Thats cool! Thank you for the reply. I have another question if i may: In Combu 2 i had used autoping for disconnect previous user on same user login. How can i achieve to block user for multilogin in combu 3?

 
Posted : 27/02/2017 10:02 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

The easiest way is to set CLEAR_PLAYER_SESSIONS to TRUE in your config, so after each login the system should delete all previous sessions of that user and this invalidates every request to web services from other clients where the user was authenticated.

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 27/02/2017 10:18 pm
(@megaman)
Posts: 34
Trusted Member
Topic starter
 

Skared Creations said
The easiest way is to set CLEAR_PLAYER_SESSIONS to TRUE in your config, so after each login the system should delete all previous sessions of that user and this invalidates every request to web services from other clients where the user was authenticated.  

Thats simple! Thanks!!! Have a great day.

 
Posted : 27/02/2017 10:22 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

Anyway I'll add an event handler for this situation of auto-logoff that will be raised directly inside the Ping method, so it'll be easier to get the event notification in your app.

Meanwhile please let me know if CLEAR_PLAYER_SESSIONS works as intended, I didn't really try it till now but looking at the code it should work 🙂

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 27/02/2017 10:25 pm
(@megaman)
Posts: 34
Trusted Member
Topic starter
 

Skared Creations said
Anyway I'll add an event handler for this situation of auto-logoff that will be raised directly inside the Ping method, so it'll be easier to get the event notification in your app.

Meanwhile please let me know if CLEAR_PLAYER_SESSIONS works as intended, I didn't really try it till now but looking at the code it should work 🙂  

 

Still able to multilogin, probably need to insert custom method  into autoping for checking users and force loggout.

Yet according my tests i did 10 exits: Sessions deleted 9 of 10.

                                                     SessionTokens deleted 6 of 10.

Seems like OnApplicationQuit() doesnt fit well for this...

 

CLEAR_PLAYER_SESSIONS = TRUE

void OnApplicationQuit()
{
      CombuManager.platform.Logout(null);
}

 
Posted : 27/02/2017 10:56 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

megaman said

 

Still able to multilogin, probably need to insert custom method  into autoping for checking users and force loggout.

Yet according my tests i did 10 exits: Sessions deleted 9 of 10.

                                                     SessionTokens deleted 6 of 10.

Seems like OnApplicationQuit() doesnt fit well for this...

 

CLEAR_PLAYER_SESSIONS = TRUE

void OnApplicationQuit()
{
      CombuManager.platform.Logout(null);
}  

Yes it was not really deleting ALL sessions but only those up to "yesterday". Anyway I fixed that, created the page in web admin and also added a method in Unity for auto login (to be called by developer if he wants to remember username and password).

I want also to get rid of Session table completely and keep only SessionToken, then I'll release Beta6 (I suggest to subscribe to the post of Beta on this forum)

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 28/02/2017 11:08 am
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

Beta 6 is out, please read the changelog carefully, it contains a couple of queries to execute on your database.

Let me know if you find any issues, thanks.

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 01/03/2017 4:15 am
Share: