/** * Save the page the user needs to be redirected to after a successful authentication * * @param string $redirect_to * @return string */ function rublon2factor_login_redirect($redirect_to) { if (!empty($redirect_to)) { RublonCookies::storeReturnURL($redirect_to); Rublon_Transients::setTransient('rublon_login_redirect', $redirect_to); } return $redirect_to; }
/** * Retrieve the return URL from the cookie * * @return string */ public static function getReturnURL() { $cookieName = self::COOKIE_PREFIX . self::COOKIE_RETURNURL; $returnURL = self::_getCookieData($cookieName); self::_clearCookieData($cookieName); if (empty($returnURL)) { $returnURL = Rublon_Transients::getTransient('rublon_login_redirect'); } return !empty($returnURL) ? $returnURL : ''; }