Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best place to add logged in user code?
Message
From
05/07/2010 04:12:07
 
 
To
04/07/2010 16:58:07
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 4.0
Miscellaneous
Thread ID:
01471365
Message ID:
01471372
Views:
41
>A continuation of the my user ID question. I am thinking about saving the UserID to a session variable if there is a valid user id and the session variable is empty. This would minimize my database hits. The web page I am working on has a master page with the header and login controls setup. Seems to me that if I always include that master page in my web pages then that would be the best place to put this code to make sure it runs on every hit. Is there a better place?
>
>Thanks.

You could do it that way. Or just write the session variable from the log-in page. It depends on how likely it will be that the information will be needed.
Also, if you need various bits of information about the user then you could put them in a custom class and store that in the session variable - only having the Id means you'd probably have to go back to the DB again anyway.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform