You know that any element in $\varphi \in W^{1,2}([-1,1])$ is Hölder continuous, in particular, continuous up to the boundary. Let $c_1,c_2 \in \mathbb{C}$ solve
$$
\begin{pmatrix}e & e^{-1} \\ e^{-1} & e \end{pmatrix}\begin{pmatrix} c_1 \\ c_2 \end{pmatrix}=\begin{pmatrix} \varphi(1) \\ \varphi(-1) \end{pmatrix},
$$
which we can always solve uniquely since $\det (M)=e^2-e^{-2} \neq 0$ .Note that, by plugging in the boundary values, you also have
$$
T(\varphi-c_1e^x-c_2e^{-x})=0,
$$
where $T$ is the trace operator. Hence
$$
\psi=\varphi-c_1e^x-c_2e^{-x} \in W^{1,2}_0([-1,1]),
$$
since $T \psi=0$, and rearranging yields your desired identity.