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!
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
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?
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
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.
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
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);
}
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
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