\documentclass{article}
\usepackage{hyperref}% hyperfootnotes

\makeatletter
\newcommand*{\savecurrentlabel}{%
  \let\saved@currentlabel\@currentlabel
  \let\saved@currentHlabel\@currentHlabel
  \let\saved@currentHref\@currentHref
  \def\restorecurrentlabel{%
    \let\@currentlabel\saved@currentlabel
    \let\@currentHlabel\saved@currentHlabel
    \let\@currentHref\saved@currentHref
    \let\restorecurrentlabel\relax
  }%
}
\let\restorecurrentlabel\relax

\begin{document}

\section{hello}\label{sec:hello}

\makeatletter
\typeout{@currentlabel: \@currentlabel}
\typeout{@currentHlabel: \@currentHlabel}
\typeout{@currentHref: \@currentHref}
%\savecurrentlabel

Hello\footnote{\label{foo}abc} World\footnote{\label{bar}def}.

%\restorecurrentlabel
\typeout{@currentlabel: \@currentlabel}
\typeout{@currentHlabel: \@currentHlabel}
\typeout{@currentHref: \@currentHref}

\label{sec:hello2}
\newpage
See \ref{sec:hello} and \ref{sec:hello2}.\\
See footnote \ref{foo} and \ref{bar}.\\
See nameref: \nameref{bar}.

\newpage
\section{World}\label{sec:world}

\begin{minipage}{.5\linewidth}
Minipage\footnote{mini}.
\end{minipage}
\label{sec:world2}

\begin{tabular}{l}
Tab\footnotemark
\end{tabular}
\footnotetext{tab}

\label{sec:world3}

See world refs \ref{sec:world}, \ref{sec:world2}, and
\ref{sec:world3}.

\newpage

\begin{tabular}{l}
Tab4\footnotemark[4]
\end{tabular}
\footnotetext[4]{tab4}

\label{sec:world4}
See world ref \ref{sec:world4}.
\end{document}
