Forum Moderators: open
I would like to show some type of status on every page they visit, and I have two choices - make a Session variable for the status and reference it on every screen, or run a query on every screen to check for it.
Both aren't great solutions. The constant query can affect DB performance, the constant Session affects the server performance.
So, which is the preferred method?
I do the session, its only text data, I put a custom sessionStart() function in that pulls the user profile and creates a load of session variables.
Another option is to pass it around every page in a form or querystring (M$ rep told me there is a setting in IIS6 or .NET somewhere to "session-mung all querstrings" like amazon/hotmail do and even works when load balancing over multiple servers unlike normal sessions)
Is there any difference in session and cookie?, sessions are implemented using a cookie after all.
A session uses a cookie as a unique identifier. That identifier references data stored in memory on the server. You can use the cookie to store the data on the users machine rather than using up server memory.