简体   繁体   中英

Access Playframework Session in JavaScript

I am using Play 2.0.3 / 2.0.4. I create a cookie on the server side (default name = PLAY_SESSION) and am trying to access it in javascript.

I have set the application.session.httpOnly=false in application.conf file. However accessing the cookie in javascript return null. Looking up the cookie in Chrome says

Accessible to script: No (HttpOnly)

Not sure why the cookie is not marked accessible to script

The correct key in application.conf file to use is session.httpOnly . This key was added in this commit .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM