WordPress.org

Forums

WP Favorite Posts
Cookies expire time frame (5 posts)

  1. Tech4Eleven
    Member
    Posted 1 year ago #

    i thought I posted this before but Id like to know if the cookies expire after a given time and if not, can I make them expire?

    function wpfp_set_cookie($post_id, $str) {
        $expire = time()+60*60*24*30;
        return setcookie("wp-favorite-posts[$post_id]", $str, $expire, "/");

    this part of the code makes me think that it will expire or I should be able to tell the system when the cookies should expire.

    http://wordpress.org/extend/plugins/wp-favorite-posts/

  2. Tech4Eleven
    Member
    Posted 1 year ago #

    no one?

  3. avieyto2013
    Member
    Posted 1 year ago #

    30 days

  4. Tech4Eleven
    Member
    Posted 1 year ago #

    Any way to change that number?

  5. kevin heath
    Member
    Posted 1 year ago #

    Just change the line

    $expire = time()+60*60*24*30;
    to what you want,

    expire time is in seconds so the first 60 changes it to minutes, the second 60 changes it to hours, the 24 changes it to days and the 30 changes it to approx. month.

    If you want 7 days just change the 30 to 7.

    thanks
    Kevin

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic