Olav Grønås Gjerde

profile image
Full stack system architect with passion for Unix, Java, Python and databases.
Twitter @olavgg
2 years ago

Secure cookie flag for Grails 3

Add this to your application.yml

server:
    servlet:
        session:
            cookie:
                domain: olavgg.com
                http-only: true
                path: /
                secure: true

This should work with Grails 4+ and I have verified that it works with Grails 5

For older Spring versions and Grails 3 this was

server:
    session:
        cookie:
            domain: adminpanel-test-boost.ai
            http-only: true
            path: /
            secure: true