move index page js code to session.js file.