adding Headers and Session object in Javascript scope