how to prevent websites from log you out due to inactivity
Asked Answered
H

1

10

I am working with 5 different websites which have short session life, they log out in 10 - 15 mins of inactivity. I came up with browser extension to do the jon for me. and what I did so far:

  1. reloading the page.
  2. open another tab from the same host and close it automatically.
  3. switch tabs to be active automatically ( like every 2 minutes one of thes websites becomes active).

those seems to be working, but they had very bad user experience.

also, reloading the page might cause losses of the work that I am doing.

I tried to make some requests on the background but these websites use alot of headers and cookies which seems to be very hard to figure out how to use them.

is there a better way to stop logging off due to inactivity or a proper way to figure out which headers and cookies should I attach with my request??

I really don't know which stack these websites are using but it seems that they have a high security standards.

Ham answered 26/11, 2020 at 9:10 Comment(3)
"is there a better way to stop logging off due to inactivity or a proper way to figure out which headers and cookies should I attach with my request??" You can attach all headers and cookies your browser attaches.Jointly
do you know a way I can attach all headers and cookiesHam
In Firefox or Chrome I'd press Ctrl+Q, go to Network and choose one request. There I'd copy all headers. Next I'd go to Storage and copy all cookies.Jointly
A
4

What I tend to do is once the "Are you still there?" message pops up, I right click, inspect, copy the selector, then do this in the console:

# paste your selector in this variable
selector = "#j_idt473 > div.modal-footer > a.btn.btn-primary.btn-sm"
document.querySelector(selector).click()

If that works, I then put it in a intervalID = window.setInterval(callback, milliseconds) call. I stop the loop with window.clearInterval(intervalID) if needed.

Not sure if you'd consider a realtime hack, this is StackOverflow after all.

Aspire answered 8/2, 2022 at 23:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.