This project is read-only.

Expires field not being set properly

Jul 26, 2009 at 4:16 PM

I'm using the Custom SessionState provider with a SQL database backup. I've been finding that when a memcached node goes down, I am losing my session state.  I looked up my session record in the database, and was surprised to find that the Expires field is being set to a few seconds before the Created field.  That appears to cause proc_CleanExpiredData to dump those records out of the database whenever the database backup is used. 

The Timeout field reflects the 120min timeout I set-up in the web.config. Am I doing something wrong that is causing the Expires field to be set incorrectly?

Thanks for your help,

Mitch

 

SessionId ApplicationName Created Expires LockDate LockId Timeout Locked

mgft0l55ufghuavhbq5fdtuz / 2009-07-26 11:09:19.867 2009-07-26 11:09:14.557 2009-07-26 11:09:05.720 1 120 0

 

 

SessionId ApplicationName Created Expires LockDate LockId Timeout Locked SessionItems Flags
mgft0l55ufghuavhbq5fdtuz / 2009-07-26 11:09:19.867 2009-07-26 11:09:14.557 2009-07-26 11:09:05.720 1 120 0 0x05000000FFFFFFFF1266625F7369675F73657373696F6E5F6B65790B66625F7369675F757365720E66625F7369675F6578706972657306557365724964045573657236000000410000004300000048000000890100000134322E31584B62527855627152446D4D525A4B4E48324339515F5F2E333630302E313234383632373630302D38313932303535393601093831393230353539360301023D000000140001000000FFFFFFFF01000000000000000C020000004E4C697665426C6F672E4C6962726172792C2056657273696F6E3D312E302E333436372E32373139322C2043756C747572653D6E65757472616C2C205075626C69634B6579546F6B656E3D6E756C6C0501000000045573657207000000035F49640A5F5370616D436F756E740A5F506F7374436F756E740A5F5468756D626E61696C035F4950055F4E616D650F5F4E65776573744174426F74746F6D0000000101010008080801020000003D000000050000004721000006030000004F687474703A2F2F617661746172732E7363726962626C656C6976652E636F6D2F323030392F342F30353161316464392D376338632D343231302D393233392D6566613862373663326432312E6A70670604000000000605000000104A6F6E617468616E204B6565626C6572010B 0

 

 

Jul 26, 2009 at 4:21 PM

One more little point on this: after the record is deleted, if I modify the session state for that SessionId again, memcached gets the session but there is no record in the database. regenerateExpiredSessionId=true. Could that not be working?

Jul 27, 2009 at 3:18 PM

I will investigate it and let you know. If problem is found, I will post a patch.

Thanks
Fahad 

Oct 22, 2009 at 11:58 AM

Hi. We are seeing similar behaviour to mitchua's second post.

Go to a page that uses session, then wait until the session should expire. Refresh the page expecting that we will get HttpContext.Session.IsNewSession == true, but we don't. Instead the user can continue to use the site implying that session is being served from somewhere, but it no longer exists in the underlying MySql database. It is as if the session data is not being detected as expired within the memcached service.

Thanks, Andrew

 

Oct 23, 2009 at 1:16 PM
That is a bug and will be fix in the next release.
________________________

On 2009-10-23 07:12:10 -0500 AndrewNewcomb <notifications@codeplex.com> wrote:

> From: AndrewNewcomb
>
> Hi. We are seeing similar behaviour to mitchua's second post.Go to a page
> that uses session, then wait until the session should expire. Refresh the
> page expecting that we will get HttpContext.Session.IsNewSession == true, but
> we don't. Instead the user can continue to use the site implying that session
> is being served from somewhere, but it no longer exists in the underlying
> MySql database. It is as if the session data is not being detected as expired
> within the memcached service.Thanks, Andrew
>
>
>
Oct 23, 2009 at 10:21 PM

Is it because the ReleaseItemExclusive method in the SessionStateProvider.cs calls this._client.Store(StoreMode.Set, id, objHolder); without setting a timeout?

Oct 23, 2009 at 10:34 PM
Yup that line sets session data in memcached for max duration. That should fix it.

Thanks,
Fahad Azeem





From: [email removed]
To: [email removed]
Date: Fri, 23 Oct 2009 14:21:19 -0700
Subject: Re: Expires field not being set properly [memcachedproviders:63570]

From: AndrewNewcomb
Is it because the ReleaseItemExclusive method in the SessionStateProvider.cs calls this._client.Store(StoreMode.Set, id, objHolder); without setting a timeout?

Read the full discussion online.
To add a post to this discussion, reply to this email (memcachedproviders@discussions.codeplex.com)
To start a new discussion for this project, email memcachedproviders@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com