Skip to content

Commit

Permalink
Merge pull request #6 from noppoMan/noppoMan-patch-1
Browse files Browse the repository at this point in the history
fix bug of context.session is null on first access
  • Loading branch information
noppoMan authored Jul 13, 2017
2 parents 56ebd59 + 6f0109d commit 7c87dc4
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 @@ -56,10 +56,10 @@ public final class SessionMiddleware: Middleware {
for cookie in cookies {
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
break
} catch {
//print("Session was failed to read. reason: \(error)")
Expand Down

0 comments on commit 7c87dc4

Please sign in to comment.