Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › eStore – Cookie not being stored
Tagged: pay per view, ppv, video session
- This topic has 5 replies, 2 voices, and was last updated 9 years ago by EPage.
-
AuthorPosts
-
October 27, 2015 at 1:00 am #13214EPageMember
I’m using WP eStore for Pay Per view content. The idea is that I want someone to be able to buy access to view a video for 24 hours (or a similar time frame). I’m fine if they are limited to a single computer. I set up the system with 1 allowed use, and the duration to 1500 minutes (yes, it’s 25 hours but the math is easier) and everything was great while I was testing on my computer.
But then I closed my browser (Firefox on a PC running Windows 10) and when I started the browser up the content was no longer viewable and the cookies that were written when I went to the page were gone.
If these cookies were persistent for the time period I need, then I think this is perfect.
I don’t want people sharing the links, so setting the download limit higher does not work for this application and I can’t tell people that they have to keep their browser open until they have completed viewing the video.
Thanks in advance for any help you can provide.
October 27, 2015 at 7:26 pm #71741wzpModerator- Whenever a link, to an APR protected page is clicked; the APR cookie is set, just before redirection. The browser is told to erase the cookie, at the end of the current browser session.
- If the expiry is longer than the browser session, say the 25 hours you proposed, the returning user is expected to use the same link; so that a new APR cookie can be set.
I don’t want people sharing the links, so setting the download limit higher does not work for this application and I can’t tell people that they have to keep their browser open until they have completed viewing the video.
You can adjust both the number of times, and the number of minutes, a link can be used. In the worse case scenario, the sharing is limited to the number of clicks or minutes specified for the expirty. If the content is “that valuable,” you can also use eMember, to restrict the number of simultaneous logins and IP addresses used to view the content.
And using a one-time persistent cookie would not prevent sharing. Like links, cookies can be shared.
October 28, 2015 at 8:28 pm #71742EPageMemberIf I wanted to edit the cookie expiration manually, can that be done in the code?
If so, can you point me in to the right file or code? For my use, I seriously doubt someone would be smart enough to share a cookie, but it’s really easy to forward an email to a bunch of buddies.
October 28, 2015 at 9:08 pm #71743wzpModeratorIf I wanted to edit the cookie expiration manually, can that be done in the code?
Yes, but you do so at your own risk; as you will have created an unsupportable fork.
If so, can you point me in to the right file or code?
- Edit the eStore_classes/eStore_aprtp.php file.
- Look for the eStore_aprtp::cookie_set method.
- Change the expire parameter of the PHP setcookie() function, to some unreasonably high value.
October 28, 2015 at 10:37 pm #71744EPageMemberI totally understand not being supported once I customize the code.
Thank you for pointing me to the right place.
October 29, 2015 at 12:15 am #71745EPageMemberI changed
if(setcookie($cookie_flavor, $cookie_dough, 0, ‘/’, COOKIE_DOMAIN))
to
if(setcookie($cookie_flavor, $cookie_dough, time()+60*60*24, ‘/’, COOKIE_DOMAIN))
and the cookie now expires in 24 hours.
Perfect and thank you very much for the truly amazing tech support.
-
AuthorPosts
- You must be logged in to reply to this topic.