Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › How to expire the cookie on pay-per-view
- This topic has 2 replies, 2 voices, and was last updated 11 years, 2 months ago by sawyerjw.
-
AuthorPosts
-
July 22, 2013 at 3:50 am #9368sawyerjwSpectator
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 #56735wzpModeratorYou 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 #56736sawyerjwSpectatorThanks 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.
-
AuthorPosts
- You must be logged in to reply to this topic.