I have a site wide disclaimer which prevents access to pages unless the disclaimer has been accepted (which sets a cookie for the check). This doesn't apply to media however, is there a ways to make media only servable after the disclaimer has been set / only serve media based on a set cookie?
You will probably need to write some sort of middleware code (would have been an IHttpHandler in old .Net) which checks for the cookie before allowing access.
Restricting media based on cookie
Hi,
I have a site wide disclaimer which prevents access to pages unless the disclaimer has been accepted (which sets a cookie for the check). This doesn't apply to media however, is there a ways to make media only servable after the disclaimer has been set / only serve media based on a set cookie?
Thanks. -Adrian
You will probably need to write some sort of middleware code (would have been an IHttpHandler in old .Net) which checks for the cookie before allowing access.
This post should get you started intercept-all-media-requests
Thanks, that looks very helpful.
shout if you get stuck on anything
is working on a reply...