  We constrain the history of reionization using the data from Planck 2015
Cosmic Microwave Background (CMB) temperature and polarization anisotropy
observations. We also use prior constraints on the reionization history at
redshifts $\sim7-8$ obtained from Lyman-$\alpha$ emission observations. Using
the free electron fractions at different redshifts as free parameters, we
construct the complete reionization history using polynomials. Our construction
provides an extremely flexible framework to search for the history of
reionization as a function of redshifts. We present a conservative and an
optimistic constraint on reionization that are categorized by the flexibilities
of the models and datasets used to constrain them, and we report that CMB data
marginally favors extended reionization histories. In both the cases, we find
the mean values of optical depth to be larger ($\approx0.09$ and $0.1$) than
what we find in standard steplike reionization histories ($0.079\pm0.017$). At
the same time we also find that the maximum free electron fraction allowed by
the data for redshifts more than 15 is $\sim0.25$ at 95.4\% confidence limit in
the case of optimistic constraint.
