Limit 1 session per user in sharepoint page
We're developing a video site that will be on sharepoint, we want to limit the users to be able to watch 1 video at a time.
The limitations I have for this: -Enable session state is not active in the farmThe things I do have control on:
-Master page -The code itself(the video webpart etc)The problem with Cookies for instance, is when to delete them, I override "unload" and "dispose" events of the we开发者_运维百科bparts and the page.Request wasn't available in that context
If there are solutions with Session - do suggest, but I prefer solution without the need to activate it
Thanks in advance.
found the solution for anyone who's looking:
first I put a check if there's an existing cookie on the relevant webparts, if not I create those webparts as usual and create the cookie
Second I registered the event "onunload" of the body element in the masterpage,
there I put javascript that called webservice which is responsible of clearing the created cookie- only if it was created from the same location who called the "onunload" event(I kept the url as value in the cookie)
If session is usable- the solution is the same just keeping the data in the session
Thanks for your comments
精彩评论