the same function is available in odoo 8. The only difference is that the http.py file is located at the root of odoo directory and not in addons/web . One more thing. If you server doesnt have a heavy request, it could be better for you to increase the top limit of the random value : for example
if random.random() < 0.1:
This is valid for session timeout from the server and not from HR module
To automaticaly sign out of HR attendance, this is one of the steps you can do:
1. Create a module that depends on hr.attendance
2. inherit the hr.employee class
3. define a function that you can call in an action. this function is in the new hr_employe class you created
4. Inside the function, for each employee (hr.employee) define a routine to check if the session is active for the user (res.user) related to the employee (it can be similar to the function in http.py session_gc(session_store) without the random ). dont forget to import packages like os, sys
5. When the user has no active session, if employee.state=='present', call attendance_action_change(cr, employee.id, [], context=None) . This function is already defined in the hr.employee under hr.attendance module
6. Create an action that you can call, lets say every 5 min. Bind it on the hr.employee object with the function you created on step 3