Question

I am storing id as a string in session in play framework with scala.

Redirect("/").withSession("userId" -> id.toString)

I want to know is it possible to store it in Long type, because every time when i have to use it i am converting it again into Long again.

Was it helpful?

Solution

Nope. Well the Http Header that you receive is an ascii string.

And hence on setting header or on receiving, you will manually have to convert your cookie pair (userId) to String and and back to Long respectively

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top