Click here to Skip to main content
15,906,341 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
If I want to maintain filtered data into entire application functionality which technique is suitable to main that.
The data should be available in entire my functionality and should not destroy whenever the navigation happened from one action to another action.
Posted

1 solution

Use the Session

https://msdn.microsoft.com/en-us/library/ms178581.aspx[^]

I'd only recommend this if the data to be kept is small, or the number of concurrent users is small.
 
Share this answer
 
Comments
DGKumar 8-Sep-15 10:50am    
If i use session that will not differentiate into multiple tabs. I want to maintain session id with guid. Is this suitable approach to generate unique session id to maintain different data for different tabs?
F-ES Sitecore 8-Sep-15 11:00am    
If session survives tabs depends on how the browser implements tabs. If you want to guarantee tab-safe usage you'll need to effectively manage your own sessions. Create an ID you store to a persisted cookie (give it an expiration date) and store data in the Cache with that ID as a key. To get that user's data you get it from the cache based on the key read from the cookie. Your challenge is then deciding when to clean that data up. Easiest would be to give it a sliding expiration time, but in that case you'd need to keep updating the expiry date of the cookie too to try and prevent a situation where a user has a valid cookie but no matching data in the cache.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900