0

I have a Wordpress site with sensitive private data and I email the link of the whole page to a client via email etc.

How can I expire the link after 1 Session, So if a client opened the link to visit the site and closed the page that link wont work anymore and the Wordpress is not accessible, saying the session has expired Please ask for another session.

How can I do that?

5
  • Define one session: by time? You could schedule a job to remove the page after a certain time after the first visit and record in the post meta that you've done this. Or e.g. by giving the user a cookie and then only allow them to return to the page with the cookie? Again you could set this up in post meta on the first visit. Or something else?
    – Rup
    Commented Oct 1, 2020 at 12:53
  • I just want to use Expiry Links as a type of OTP, once you close the page you cant reopen ti, but I'm up for also one-day expiry no problem, I just don't know how to block the whole website and access it only with expiry links,
    – JadoBulku
    Commented Oct 1, 2020 at 13:18
  • Note that the URL will likely expire due to requests to try and get a preview of the page, or sitemap exploring bots. Fundamentally this is not a secure design, at the very least it needs to have a password or be behind a login. Otherwise anybody can do an enumeration attack with a simple script and grab all sensitive data, leaving it inaccessible for the real users
    – Tom J Nowell
    Commented Oct 1, 2020 at 13:18
  • Are you trying to implement email based 2FA? Or login magic links?
    – Tom J Nowell
    Commented Oct 1, 2020 at 13:20
  • The idea is that I don't want the content of the website to be public because they are clinical data, I just want that maybe I could lock the site and give a 24h regenerated password to clients (but I couldn't find that possible with WordPress), so I thought about Expiry links, which expire every 24h, either way I'm open for ideas, I just don't want to have the website public and be asked (the clinic) for Access. Thank you
    – JadoBulku
    Commented Oct 1, 2020 at 13:42

1 Answer 1

0

This plugin fits most of the requirements that you need:

https://wordpress.org/plugins/public-post-preview/

It allows you to share a preview of the page to anyone with the link.

You can modify the expiry time with a filter.

add_filter( 'ppp_nonce_life', 'my_nonce_life' );
function my_nonce_life() {
    return 60 * 60 * 24 * 1; // 1 day
}
1
  • I'll give it a try, thanks
    – JadoBulku
    Commented Oct 2, 2020 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.