Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature idle session expiry #7686

Closed

Conversation

saleemkce
Copy link
Contributor

Fix for issue #7316 Now, no idle user could spend more than 3 days opening the piwik admin panle idle. Added jquery script whic tracks user engagement with the site.

@saleemkce
Copy link
Contributor Author

Additionally, I have given 3 days of inactivity in Piwik admin page as session expiry time. But, we could adjust this based on our collective decision.

** Possible scenarios when this is most useful,

  • user opens the tab and goes somewhere
  • user has opened the browser tab in the past but never checked the tab again but visits other sites in the browser
  • user accidentally opened the Piwik admin site in another person's place but forgot to close down

Also, it will never auto-expire when user is not idle.

@mattab
Copy link
Member

mattab commented Apr 16, 2015

Hi @saleemkce
what you want to achieve is that user should be logged out after N days of inactivity. To do this we need to do it server side rather than client side. Otherwise if you close the browser and wait 10 days you would still be logged in... the correct way would be to somehow change the Login plugin authentication or so to enforce this maximum of N days.

@mattab mattab closed this Apr 16, 2015
@mattab mattab added the wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it. label Apr 16, 2015
@saleemkce
Copy link
Contributor Author

Hi @mattab This is the only case which I suppose is not covered in my fix, I have a pure client-side based solution for this case with very little support needed from server-end, I am working in this and will soon publish the fix for the benefit of everyone. Because I don't want to poll (load) the DB periodically with HTTP requests, my solution should be quite unique!

@mahesh978
Copy link

hi i used above solution which you shared but session is not getting expired after sometime.

@saleemkce
Copy link
Contributor Author

@mahesh978 It has been long time since I suggested functionality this PR. I don't have control over this much. But as far as I know, I tested this piece of jquery script and it worked fine. May be it's not loaded correctly in your case. Just copy my code alone and paste it right before closing body tag. Change the test value from idleWait = 259200000; to idleWait = 10000 (10 seconds). Login, just switch browser tab and come back after 15 seconds. It should have redirected. Make sure jquery script is executed correctly by putting a test javscript alert.

@saleemkce
Copy link
Contributor Author

I have created sample HTML page in pastebin to test it for 10 seconds inactive browser tab. Double click the page and switch to another tab. It will redirect to logout page in 10 seconds when idle.

@mahesh978
Copy link

thanks for your reply @saleemkce but still there is no session logout after 15 sec also and alert is also not coming which i added in js.

@mahesh978
Copy link

the same html code is working fine but i think the issue with matomo only

@saleemkce
Copy link
Contributor Author

@mahesh978 "alert is also not coming which i added in js." which denotes that JS is not loaded in your admin site properly. Please try other methods to load the JS. It should work fine then.

@mahesh978
Copy link

mahesh978 commented Feb 22, 2018

yaa @saleemkce may be file is not getting loaded is there any other way to load js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants