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

How to expire the cookie on pay-per-view

by

Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › How to expire the cookie on pay-per-view

Tagged: expire cookies, pay-per-view access options

  • This topic has 2 replies, 2 voices, and was last updated 11 years, 10 months ago by sawyerjw.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • July 22, 2013 at 3:50 am #9368
    sawyerjw
    Spectator

    I am using eMember in a slightly non-standard way. My client has a questionnaire that her customer fills out which generates a report based on the responses to the questionnaire. She wants the customer to pay first, then access the questionnaire. She wants them to be able to access the questionnaire once per payment.

    I have this working by treating it as a pay-per-view situation. The buyer clicks the buy button which sends them to PayPal. When their payment is complete, they’re returned to the thank-you page. They receive the email with the “download” link in it which works fine. I have limited the download link to 1 download, so they can’t click the email link more than once.

    The problem is that when they submit the questionnaire and then download the report from the results page, they can simply click the back button on the browser and return to the questionnaire as many times as they want to until they close the browser. The cookie does not expire until the browser session ends. I understand that this makes sense for a pay-per-view or download situation.

    What I would like to be able to do is to expire the cookie once they access the questionnaire so that after submitting the form and getting the results, if they return to the protected page, they’ll see the “Sorry, you have to purchase access” message because the cookie will have expired.

    Is there a way to do this? I have no problem writing a bit of back end code if that’s what’s needed. I’ve already tried a couple of things that didn’t work, so apparently I’m missing something in the equation.

    This would make a good feature for this plugin, IMO. There is already an option to expire the download link after a period of time and/or after X number of downloads. It would be great to have an option to expire the access to the protected page after a period of time, or X number of accesses, as well.

    Thanks in advance for any assistance.

    July 22, 2013 at 3:59 am #56735
    wzp
    Moderator

    You should be able to establish an expiry for the APR links.

    http://www.tipsandtricks-hq.com/ecommerce/using-wordpress-permalinks-as-digital-products-apr-1217

    Try setting the expiry for 1 minute.

    July 26, 2013 at 1:07 am #56736
    sawyerjw
    Spectator

    Thanks for the response. I currently have the expiry set to 30 minutes. I will have to test with 1 minute to see if there are any issues with that. This page is a questionnaire with several required fields. If they click the Submit button and have missed a required field, the page refreshes (I think), which would be a problem with a 1-minute expiry. I believe the form has the ability to submit via Ajax which may solve the problem. In any case, I know what to look for now.

    It still would be nice to have the ability to expire the cookie on demand for situations like this where it will take the buyer a variable amount of time to fill out the form and submit it. “Expire on successful submit” would be ideal. :-)

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 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