A colleague of mine is developing an access controlled solution which prevents users logging in with the same credentials from mutliple locations, using ASP.net membership. For this he checks session expiry times against the last activity date in the database to see if the user has left the site allowing the session to expire- but he noticed today the code had stopped working.
The clocks went forward an hour in the UK on Sunday just gone as we go into British Summer Time (BST) instead of GMT which turned out to be the problem. ASP.net membership logs all times in the database using UTC time, matches GMT- the moment we moved into BST we came an hour out of sync! So he had to convert the code to change our local GMT time to UTC before running any comparisons. Sql server actually has a function to return the current UTC date/time;
GETUTCDATE()
Related posts:
- ASP.net Roles and Membership installed to local SQL Express 2008 MDF file
- SessionId re-generated on each page hit
- Setting up session state database on sql server
- MySQL 5.1 with DotNet claims Procedure or function ‘
‘ cannot be found in database ‘ ‘ - Collation issues setting up ASP.Net membership tables










