HELP in Session management in Table Storage RRS feed

  • Question

  • Hi,

    I'm trying to implement Session Management in Table Storage using the TableStorageSessionStateProvider. I'm trying to cleanup the expired sessions using threads in the WebRole instead of the WorkerRole.

    I have a few doubts. The Session data is being stored in blobs, but there is only one entry in the Session Table which reflects only the last blob entry.

    How is the session table and blob container linked?

    As soon as i launch the application, there is a blob already present in the container even before i add any data to session. What is that?

    The code itself runs fine. I use the LastModifiedUTC property to check for expiry and delete the blobs like so:


    var blobarr = container.ListBlobs();

    foreach (CloudBlob blober in blobarr)


         if (blober.Properties.LastModifiedUtc < DateTime.UtcNow.AddMinutes(-1))//Assuming one minute expiry timeout


           Trace.WriteLine("Deleting " + blober.Properties.LastModifiedUtc.ToString() + "\n\n");                           




    After all the session blobs have been cleaned up, of i try to add anything to session again, it shows a "blob not found" error.

    Has anybody implemeted clearing of expired sessions in table storage?

    Monday, March 12, 2012 12:58 PM


All replies