Login failed - session is already expired

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

andrew2110
Posts: 90
Joined: 28 May 2008, 13:36

Login failed - session is already expired

Postby andrew2110 » 26 Sep 2022, 15:30

Have been coming across this little issue now and then recently but haven't been able to track down exactly what could be causing it:

Using a custom login on 2.17.0 (the user id is the smartfox username shown in Login failed:)

It seems to fail the login, in a way that I can't catch or figure out why it happens. Its very intermittent and happens <0.1% of the time but the users do love to shout at me when it happens.

I suspect theres an issue in the server side extension - one fast way I can fix this is via an option in my admin panel to clear the current cached data. Is there any way I can catch the inbuilt "WARN - Login failed:" message so I can try to figure out where the bug lays in this.


Code: Select all

26 Sep 2022 | 06:55:13,883 | INFO  | SocketReader | bitswarm.sessions.DefaultSessionManager |     | Session removed: { Id: 75531, Type: DEFAULT, Logged: No, IP: 104.205.158.199:49162 }
26 Sep 2022 | 06:55:14,525 | INFO  | SocketReader | bitswarm.sessions.DefaultSessionManager |     | Session created: { Id: 75532, Type: DEFAULT, Logged: No, IP: 104.205.158.199:49163 } on Server port: 9933 <---> 49163
26 Sep 2022 | 06:55:15,249 | WARN  | SFSWorker:Ext:66 | v2.api.SFSApi |     | Login failed: 1710030595 , session is already expired!
26 Sep 2022 | 06:55:20,040 | INFO  | SFSWorker:Ext:87 | entities.managers.SFSRoomManager |     | Room removed: { Zone: H3D }, [ Room: R136479, Id: 216433, Group: NR, isGame: true ], Duration: 29820
26 Sep 2022 | 06:55:23,917 | INFO  | SocketReader | bitswarm.sessions.DefaultSessionManager |     | Session removed: { Id: 75532, Type: DEFAULT, Logged: No, IP: 104.205.158.199:49163 }
26 Sep 2022 | 06:55:24,549 | INFO  | SocketReader | bitswarm.sessions.DefaultSessionManager |     | Session created: { Id: 75533, Type: DEFAULT, Logged: No, IP: 104.205.158.199:49164 } on Server port: 9933 <---> 49164
26 Sep 2022 | 06:55:25,263 | WARN  | SFSWorker:Ext:66 | v2.api.SFSApi |     | Login failed: 1710030595 , session is already expired!
hng
Posts: 37
Joined: 01 Nov 2021, 18:17

Re: Login failed - session is already expired

Postby hng » 27 Sep 2022, 03:13

after client connect you must immediately login, you could check the time the client successfully connect and the time you get the session expire.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Login failed - session is already expired

Postby Lapo » 27 Sep 2022, 07:22

Hi,
the "session is already expired" error happens when Users take too much time logging in and the Session expires. There is a global setting under AdminTool > Server Settings that controls the maximum idle time of a Session. By default it is 20 seconds.
I'd recommend to use a value < 60 seconds, as this will protect the server from "hanging" Sessions.

Keep in mind: this value only affects clients that are not logged in yet.

As regards catching this specific Exception in an Extension it is not possible because the Session check is done before the Extension is given control.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 58 guests