Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

eStore – Cookie not being stored

by

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, 7 months ago by EPage.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • October 27, 2015 at 1:00 am #13214
    EPage
    Member

    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 #71741
    wzp
    Moderator

    • 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 #71742
    EPage
    Member

    If 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 #71743
    wzp
    Moderator

    If 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?

    1. Edit the eStore_classes/eStore_aprtp.php file.
    2. Look for the eStore_aprtp::cookie_set method.
    3. Change the expire parameter of the PHP setcookie() function, to some unreasonably high value.

      http://php.net/manual/en/function.setcookie.php

    October 28, 2015 at 10:37 pm #71744
    EPage
    Member

    I 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 #71745
    EPage
    Member

    I 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.

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ