Update cs_session_provider.js

some corrections and refactory.
Merge pull request #48 from lmacsen/master

Update cs_session_provider.js