Wednesday, September 26, 2007

Generate Random SQL Data

If you ever need random data for your SQL tables, be sure to check out http://www.generatedata.com/. Their random data generator generates transact SQL scripts that you can run to insert random data into your database. Other export formats are also available.

Tuesday, September 18, 2007

ASP.NET Login Control Remember Me Doesn't Work

I recently did a quick Google search for an issue I was having with the ASP.NET login control where the Remember Me feature of the control appeared not to be working as I had expected. I found a few hits on Google Groups where users were experiencing the exact same symptom, but nobody was getting an answer to their question.

First of all, I knew that the login control called the FormsAuthentication.SetAuthCookie() method to save the cookie, so I figured it must have something to do with the cookie expiring sooner than I wanted. Knowing that, I looked at the details of the cookie and noticed that it was set to expire 30 minutes in the future. So I did another quick Google search and found a great article on Forms Authentication. Sure enough, there is a section in web.config that is used to configure the authentication cookie, one of which is the timeout. I'd recommend reading that article, first, but this is the authentication section from my web.config with the cookie timeout configured for 30 days.

<authentication mode="Forms">
<forms
loginUrl="Login/Login.aspx"
name=".ASPXFORMSAUTH"
protection="All"
timeout="43200"
requireSSL="false"
slidingExpiration="true"
cookieless="UseCookies"
enableCrossAppRedirects="false"
/>
</authentication>


Hope that helps...