views:

476

answers:

2

When implementing a custom membership provider I see that the underlying data model has ISONLINE column in the USER table, as described here: http://msdn.microsoft.com/en-us/library/6tc47t75.aspx

Question: When is this field actually updated in the database? In the sample implementation MSDN gave, there is no updating of this column, and IsOnline property is calculated as:

return (now - userIsOnlineTimeWindow > LastActivityDateTime ? false:true);

So what is the purpose of ISONLINE column in the USER table if it's never updated??? Or I am missing out on something???

Thanks

+2  A: 

I seem to remember noticing the same, and concluding that it's probably a 'left-over', ie. not used.

The implementation you quote does the trick well enough, so long as the LastActivityDateTime is updated when appropriate. I guess they just forgot to update the schema.

Tor Haugen
+2  A: 

I also realised this and assumed it was an idea that was never implemented.

Since you have LastActivityDateTime, you can always check that.

Mark Redman