Reputation: 774
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:
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.
Upvotes: 10
Views: 17505
Reputation: 70459
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.
Upvotes: 5