Hey @joseluizferreira! Thanks for the background there!
Unfortunately, tracking session_start and session_stop on a static file is potentially rife with extreme outliers as many users (myself included) leave static files open in a browser tab for long periods of time. This is also the reason that we have not done more work to this end in the product - it is data that has the potential to be high in volume and low in value.
Rather, when a user "refreshes the page," for instance, then you get a new "content hit" that shows the user has requested the file again.
In any case, if you want to continue down this path, you are delving into the realm of Google Analytics and related products (a few of which are open source: https://matomo.org and http://www.openwebanalytics.com/ ) that do pure-JavaScript analytics and data capture.
Unfortunately, today there is not a nice way for you to access the user's Connect username from a pure-browser-side javascript context. However, we are happy to share this feedback with developers for consideration in a future release! Please keep us posted how you progress here!! We are always interested to hear how Connect is being used in various environments!