plugins - How to generate expiring URL of the page?

admin2025-01-07  5

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?

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?

Share Improve this question asked Oct 1, 2020 at 12:36 JadoBulkuJadoBulku 1 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
Add a comment  | 

1 Answer 1

Reset to default 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
}
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736257652a454.html

最新回复(0)