Swiftpack.co - Package - thevojacek/Kitura-MongoDbSessionStore


A store for Kitura session in MongoDB using MongoKitten driver.


This session store accepts only MongoKitten collection as DI to work with right now, so you need to be using MongoKitten driver in order to be able to use package.

Support for official MongoDB driver will be coming as well.

Example usage

import Foundation
import Kitura
import KituraSession
import Kitura_MongoDbSessionStore
import MongoKitten

// Connect to MongoDB
let server = try Server("mongo_url")
let database = server["database_name"]
let collection = database["collection_name"]

// Kitura router
let router = Router()

// Store initialization
let store = KituraMongoDbSessionStore(collection)

// Store usage
router.all(middleware: Session(secret: "super_secret", cookie: nil, store: store))


Copyright 2018 Jan Vojáček

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at


Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Full license text is available in LICENSE.txt attached to this library.


Stars: 0
Help us keep the lights on


Used By

Total: 0


0.2.2 - Aug 24, 2018

0.2.1 - Aug 24, 2018

0.2.0 - Aug 23, 2018

0.1.0 - Aug 22, 2018