Page MenuHomePhabricator

Maintain login session if user is active
Open, Needs TriagePublic

Description

So currently the login session expires in 15 mins (irrespective of the fact that the user is currently using the session or not)
To avoid this, we should check for activeness and in-activeness of the user (based on the activity), and log out if the user is inactive for the threshold time.

Related Objects

Event Timeline

Approach 1: Creating a middleware to intercept all the apis, which basically checks if the user is logged in or not. If logged in, then refresh the cookie age (again by threshold value).

Pros:

  1. Less frequent polling to server.
  2. API call ensures user is active.

Cons:

  1. Since apart from HTTP calls, we also communicate with our server via sockets (TCP). Since this call is so frequent, we would be basically refreshing the browser cookie a lot of time in one minute time gap.

Approach 2: We check the active connections made based on socket id and mediaWikiId from our redis collection. If for a user there are no active connections, we don't refresh the cookie age.

Pros:

  1. Both HTTP and TCP connections (for client and server) would be addressed with this approach.

Cons:

  1. How and when to refresh cookies is something of a blackbox here. Do we poll our redis server from our backend service and check for the active connections status?

@Soda @Punith.nyk @Gopavasanth lmk your opinions on this.

@Reputation22 off topic question
was setting up the project in local following the steps in https://gitlab.wikimedia.org/cloudvps-repos/videocuttool/VideoCutTool

was doing these step---> Get OAuth2.0 Credentials

getting this error"Error
Requests from your IP have been blocked, please see https://wikitech.wikimedia.org/wiki/Beta/Blocked for more information.

raised ticket ...will the issue be solved this way?

image.png (1×1 px, 226 KB)

@Reputation22 off topic question
was setting up the project in local following the steps in https://gitlab.wikimedia.org/cloudvps-repos/videocuttool/VideoCutTool

was doing these step---> Get OAuth2.0 Credentials

getting this error"Error
Requests from your IP have been blocked, please see https://wikitech.wikimedia.org/wiki/Beta/Blocked for more information.

raised ticket ...will the issue be solved this way?

image.png (1×1 px, 226 KB)

Yes! It should be resolved by WMF staff, to my understanding, they are relatively active!

@Reputation22 off topic question
was setting up the project in local following the steps in https://gitlab.wikimedia.org/cloudvps-repos/videocuttool/VideoCutTool

was doing these step---> Get OAuth2.0 Credentials

getting this error"Error
Requests from your IP have been blocked, please see https://wikitech.wikimedia.org/wiki/Beta/Blocked for more information.

raised ticket ...will the issue be solved this way?

image.png (1×1 px, 226 KB)

Yes! It should be resolved by WMF staff, to my understanding, they are relatively active!

Thnx. waiting for the ticket to be fixed