MVC3 - Roles seem to get evaluated differently on different machines

Hi

I'm developing an mvc3 site which uses .net membership provider.  There are 3 roles and "all works fine on my machine".

One of the pages which has [Authorize(Roles = "member")] delivers video content.  The video is served from a separate controller which checks to see if the requested video should be served to the user based on their role.  This is evaluated by:
if(HttpContext.User.IsInRole("member"))
{... deliver file...}

Open in new window


Some vids are public, some are only for members, some only for the higher membership level etc - "all works fine on my machine".

Previously this worked fine for my customer but he is now finding that the public vids play for him but any role-validated vids are not rendered.  I've checked his user and he has all 3 roles assigned.  If I login with his user then I can view all vids no problem.  

I created a test page to display each role and show if the current user is in that role.  He viewed that and it showed he's assigned to each role.  Then the vids started working for him on one of his machines - on another it made no difference.

What could be causing this?  Some kind of role-cacheing issue perhaps?  Could viewing the new test page (which requires login) have forced the server to recreate the authentication cookie for him?

My roleManager declaration in web.config looks like this:
<roleManager enabled="true">

Open in new window


Do I need to specify additional attributes for roleManager in web.config to solve this issue?
Or do I need to evaluate the user's role membership some other way in the controller that serves the video files?

Thanks for advice.
DanziggerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

guru_samiCommented:
By default the roles aren't cached.
On the client's second machine where it didn't work, did it display the roles on the page?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DanziggerAuthor Commented:
I had accidentally hard-coded a preview URL into the script that validates the role.  The user was authenticated on the domain they were browsing under, but not authenticated on the domain that was validating access to the video.  Duh!

Very sorry for wasting your time but thanks for the info anyway!
0
DanziggerAuthor Commented:
The question wasn't really valid as it stemmed from a fundamental configuration error that I made.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.