Simple Mobile URL Redirect
[resolved] Redirect Once - less than a day (5 posts)

  1. jberg1
    Posted 2 years ago #

    Nice plugin. I see you added the "Redirect Once" that sets a cookie. Nice feature, so you can redirect to internal pages. Anyway to have that cookie expire in less than one day? Maybe every hour? So mobile users are redirected, then can surf the site and if they return the same day they are then redirected again.


  2. Kailey (trepmal)
    Volunteer Mod & Reviewer
    Plugin Author

    Posted 2 years ago #

    Not without changing the plugin code.

    Open mobile-redirect.php. Change intval to floatval on lines 71 and 133.

    With those 2 things changed, you can save a decimal value in the Redirect Once Cookie Expiry option. .04 will be give you just under an hour.

  3. Yusri Mathews
    Posted 2 years ago #

    Is it not possible to set it to when the session ends?

  4. Kailey (trepmal)
    Volunteer Mod & Reviewer
    Plugin Author

    Posted 2 years ago #

    @iammathews The "Redirect Once Cookie Expiry:" field sets how long the cookie will last for (in days).

    So if set to '7' then the user will be redirected on their first visit, but not again until after the week has passed.

  5. dynamikos
    Posted 2 years ago #

    Hi There

    I'd also like to set the cookie expiration to an hour but im not having any luck .

    I see there are 3 instances of intval in the mobile-redirect.php. Has the code changed since the last time you helped jberg ?

    Any help will be appreciated .

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Simple Mobile URL Redirect
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.