How to make password protected posts that will expire after they are used?

Try something like this

 add_filter( 'post_password_expires',           'my_cookie_time' );


   function my_cookie_time( $time ) {


return 600; // 600 = 10 minutes. Use 0 to expire the cookie at the end of the current browsing session.


   }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)