Sending cookies

Report a typo

Implement a page that displays the "Hello for the first time!" on the first visit, and "Hello" on the next visits.

What code should you put instead of the three dots in the handler code?

routing {
    get("/greeting") {

        ...

    }
}
Reorder lines using drag or arrows. Adjust indentation with left buttons
                if(call.request.cookies["notfirst"].toBoolean())
              
                }
              
                call.respondText("Hello")
              
                call.respondText("Hello for the first time!")
              
                call.response.cookies.append("notfirst", "true")
              
                else {
              
___

Create a free account to access the full topic