I have an ASP.Net app that retrieves a collection of roles for a given user. Each role is a string. There's rarely more than 2-3 roles for any one person.
I wanted to store the colelction of roles in Session state to save the time accessing the DB on each request.
I basically want to write code that checks if a given string exists in the collection to test if the user has that role or not.
My question is...what's the best way to do this? Is an array the best collection to store the role strings in Session with? Or is a dictionary better? I figure an array will take less memory (I don't really need a key + value) although a dictionary might lookup faster.
What would you suggest?