Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

Commit

Permalink
fixed some bugs in the Provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Sedward committed Jun 1, 2010
1 parent 01fbf24 commit e0577e4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions MongoSessionStore/MongoSessionStoreProvider.cs
Expand Up @@ -154,8 +154,7 @@ public override void SetAndReleaseItemExclusive(HttpContext context, string id,


// byte array to hold serialized SessionStateItemCollection. // byte array to hold serialized SessionStateItemCollection.
byte[] serializedItems = new byte[0]; byte[] serializedItems = new byte[0];
// Timeout value from the data store.
int timeout = 0;
var sessionStore = SessionStore.Instance; var sessionStore = SessionStore.Instance;
try try
{ {
Expand All @@ -171,7 +170,7 @@ public override void SetAndReleaseItemExclusive(HttpContext context, string id,
else if (session.Expires < DateTime.Now) else if (session.Expires < DateTime.Now)
{ {
locked = false; locked = false;
SessionStore.Instance.EvictSession(session); sessionStore.EvictSession(session);


} }
else if (session.Locked) else if (session.Locked)
Expand Down Expand Up @@ -324,10 +323,10 @@ public override void CreateUninitializedItem(HttpContext context, string id, int
byte[] serializedItems = new byte[0]; byte[] serializedItems = new byte[0];
Binary sessionItems = new Binary(serializedItems); Binary sessionItems = new Binary(serializedItems);
Session session = new Session(id, this._applicationName, timeout, sessionItems, 0, SessionStateActions.InitializeItem); Session session = new Session(id, this._applicationName, timeout, sessionItems, 0, SessionStateActions.InitializeItem);

var sessionStore = SessionStore.Instance;
try try
{ {
SessionStore.Instance.Insert(session); sessionStore.Insert(session);
} }
catch (Exception e) catch (Exception e)
{ {
Expand Down

0 comments on commit e0577e4

Please sign in to comment.