In my Spring Boot 1.4 based application I use Spring Session to store session data in the database with JDBC.
Spring Boot
Spring Session
JDBC
This works fine
we can apply cookieValue.trim() or cookieValue.replace(" ", "") to remove whitespaces or "spcbefore