changed session to javascript from coffeescript