Denoting the desired integral by $I=\int_0^{\infty}\!\!\mathrm{d}x\,\frac{\cosh(ax)}{\cosh x},$ we may extend the integral to $-\infty, since the integrand is a symmetric function, i.e. $\begin{align*}I&=\frac{1}{2}\int_{-\infty}^{\infty}\!\!\mathrm{d}x\,\frac{\cosh(ax)}{\cosh x}\\&=\frac{1}{4}\int_{-\infty}^{\infty}\!\!\mathrm{d}x\,\left(e^{ax}+e^{-ax}\right)\,\mathrm{sech}\,x\\&=\frac{f(a)+f(-a)}{4},\qquad(A)\end{align*}$ where we have defined $\displaystyle f(z):=\int_{-\infty}^{\infty}\!\!\mathrm{d}x\,e^{zx}\,\mathrm{sech}\,x.$ Note, as $x\to\infty$, the hyperbolic secant behaves as $e^{-x}$, hence the integrand $\sim e^{-(1-z)x}$. The integral converges iff $z<1$. Likewise, as $x\to-\infty$, the integrand goes like $e^{(z+1)x}$, hence convergence of the integral requires $z>-1$. Thus $f(z)$ is well-defined for all $|z|<1$, which is also the permitted range for the parameter $a$. That said, let’s return to the evaluation of $f(z)$. $f(z)=2\int_{-\infty}^{\infty}\!\!\mathrm{d}x\,\frac{e^{zx}}{e^x+e^{-x}}=2\int_{-\infty}^{\infty}\!\!\mathrm{d}x\,\frac{e^{(z-1)x}}{1+e^{-2x}}.$ Substituting $\displaystyle 1+e^{-2x}=\frac{1}{u}\Rightarrow\mathrm{d}x=\frac{\mathrm{d}u}{2u^2}e^{2x}=\frac{\mathrm{d}u}{2u(1-u)},$ and changing the limits of integration appropriately, we arrive at $\begin{align*}f(z)&=\int_0^1\!\!\mathrm{d}u\,\frac{u^{\frac{z-1}{2}}}{(1-u)^{\frac{z+1}{2}}}\\&=\int_0^1\!\!\mathrm{d}u~u^{\frac{1+z}{2}-1}(1-u)^{\frac{1-z}{2}-1}\\&=\mathrm{B}\!\left(\frac{1+z}{2},\frac{1-z}{2}\right),\end{align*}$ where $\mathrm{B}(x,y)$ is the beta function (https://en.wikipedia.org/wiki/Beta_function). Expressing the beta function in terms of the gamma function (https://en.wikipedia.org/wiki/Gamma_function), via $\mathrm{B}(x,y)=\frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)},$ and noting that $\Gamma(1)=1$, we can further simplify our result: $\begin{align*}f(z)&=\Gamma\left(\frac{1+z}{2}\right)\Gamma\left(\frac{1-z}{2}\right)\\&=\Gamma\left(\frac{1+z}{2}\right)\Gamma\left(1-\frac{1+z}{2}\right)\\&=\frac{\pi}{\sin\left(\frac{\pi}{2}+\frac{\pi z}{2}\right)}=\frac{\pi}{\cos\left(\frac{\pi z}{2}\right)}.\end{align*}$ In the third step above we used Euler’s well know reflection formula (https://en.wikipedia.org/wiki/Reflection_formula) $\Gamma(x)\Gamma(1-x)=\frac{\pi}{\sin(\pi x)}.$ Having evaluated $f(z)$ in closed form, we are merely a substitution away from the desired result (cf Eq. (A)). Thus, $\boxed{\int_0^{\infty}\!\!\mathrm{d}x\,\frac{\cosh(ax)}{\cosh x}=\frac{\pi}{2\cos\left(\frac{\pi a}{2}\right)}}$
Cheers!