Skip to content

Commit

Permalink
Merge pull request #3 from noppoMan/bug-fix
Browse files Browse the repository at this point in the history
move context.session = session before reading
  • Loading branch information
noppoMan authored Jul 4, 2017
2 parents 3ee2323 + 5181ef1 commit b95d13e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/HexavilleFramework/Session/SessionMiddleware.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ public final class SessionMiddleware: Middleware {

do {
let session = Session(id: cookie.value, store: store, ttl: cookieAttribute.expiration)
context.session = session
if let values = try store.read(forKey: session.id) {
session.storage = values
}
context.session = session
} catch {
print("Session was failed to read. reason: \(error)")
}
Expand Down

0 comments on commit b95d13e

Please sign in to comment.