Everything pure theory:
Serverside
1) On login: save logout time to session
2) In Page->init(), before parent::init() check if value is present in session.
3) if present, check if logout is requred and do it eventually
4) eventually you want to write these values to your javascript file via javascriptTemplate (depends on your solution)
Javascript
1) check if logout time is set (in session and/or script)
2) if present, check logout conditions and call a logout url
3) for calling a logout url, it may be required to implement an url_handler to your responsible Controller. maybe silverstripe has already one present for logging out user.