Hi, I've just joined this site after browsing for a few months, and finally bitten the bullet!
I've got a few questions as I try and get my head around the Profiling in .NET and the best way to tackle session and optimization issues I've come across.
I've designed a system where users set up their profiles and certain details need to be retained whilst the users are logged.
At first I put everything in the Profile, tested the users experience and it was fine.
But the following design issues arose:
Design 1.
I needed a facility in which users could search for other users details. Now as far as I can see, searching profiles in .NET is not very efficient and unless you create a CommonProfile instance for each user returned, the only other option is to create a SQL query that breaks down the profile string to get the details I require, neither of which seem like good efficient solutions.
Design 2.
So I decided to scrap the Profile idea and create a new table called UserProfile containing the users detail, which when the user logged in would get the required users details from the database and store them in session variables. This way the variables are available in my code when the users are logged in and its easy and efficient to search for other users details.
This worked fine until errors started occuring when a page was idle for a while. My pages perform a User.IsAuthenticated check and then access certain data through the session variables. Once authentication is passed, the session variables set to null it seems the life of the session variables seems to be shorter than that of the profile. I would of thought the two would be the same?
Design 3.
Because of the session timing out before the user, I decided to create the variables needed for the "login session" in the Profile but also keep them in the database table I created. This way when the user logs in, I set the Profile variables from those of the table and can be happy in the fact that the Profile variables aren't going to expire while the user is logged in.
(If you're still reading you deserve a medal!) So I'm currently using Design 3 which works fine, but doesn't seem to be a neat way of doing things.
Surely there's a better way of storing profile information easily accessible to when the users logged in whilst still making it easy to seach?
Also whats going on with the sessions timing out before the user?
Thanks! Steve