vibe.d beta banner
get vibe.d
0.8.4

Asynchronous I/O that doesn’t get in your way, written in D

Module vibe.db.mongo.sessionstore

MongoDB based HTTP session store.

Example

import vibe.core.core : runApplication;
import vibe.db.mongo.sessionstore : MongoSessionStore;
import vibe.http.server : HTTPServerSettings, listenHTTP;
import vibe.http.router : URLRouter;
import core.time : hours;

void main()
{
	auto store = new MongoSessionStore("mongodb://127.0.0.1/mydb", "sessions");
	store.expirationTime = 5.hours;

	auto settings = new HTTPServerSettings("127.0.0.1:8080");
	settings.sessionStore = store;

	auto router = new URLRouter;
	// TODO: add some routes

	listenHTTP(settings, router);

	runApplication();
}

Classes

NameDescription
MongoSessionStore
Authors

Sönke Ludwig

Copyright

© 2017 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.