Accepted answer

It's a case of type mismatch. The values stored in session are of string type by default. And I think the values userId is of Int or long type. So convert your session value to same type, you are comparing with i.e. use session.get("userId").get.toInt to change in integer type and then compare it.

Related Query

More Query from same tag