O'Reilly logo

D Web Development by Kai Nacke

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Storing session data

The note application is currently stateless. The entered data is displayed once and then it is lost. This is not useful. You need a place to store the data between requests. This place is the session. To use session, you have to instantiate SessionStore at server startup. A class implementing the SessionStore interface stores key/value pairs as an associative array. You start a session by calling the startSession() method of the response object and terminate a session with the terminateSession() method.

A cookie-based session is used by vibe.d. The session is available in the session member of the request if you previously called the startSession() method and if the client sends back a matching cookie.

The SessionStore is an ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required