Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scala: Play Framework 2 ignores httpOnly flag in application.conf

I want to use i18n in my Play-Application (Play 2.1, Scala). The chosen language is stored in the PLAY_LANG-Cookie, but unfortunately this cookie is httpOnly. That means I can't read its value in my JavaScript files.

I tried changing the httpOnly-Value in the application.conf, but it didn't work.

application.session.httpOnly=false

I haven't found anything on this yet, so I'd really appreciate some help!

like image 441
user2346275 Avatar asked Nov 30 '25 09:11

user2346275


1 Answers

you can pass it to your scala template in the samy way we do with session

@(implicit session:play.api.mvc.Session, lang:play.api.i18n.Lang)

now you can pass @lang.code to the javscript. does the same functianlity but by diffrent approach.

like image 90
Govind Singh Avatar answered Dec 01 '25 21:12

Govind Singh