Track and identify users with Memcached
I hav开发者_JAVA技巧e social network website that contains thousands of users. Until now I used the classic way of storing user's details in the session object. Now, I want to upgrade it, so it will work against Memcached, and the key value is the "userId".
My question is: What is or where is the best place to keep the "userId" so I can use it constantly for querying the user's details from Memcached?
Three options as I see it:
- Store it in the
ViewState[]
collection on your pages - Store it in a cookie
- Store it in all urls
these can also be combined for added security/robustness.
Best practice imo would be to combine cookie with viewstate.
精彩评论