restapi : Cookies are being set even when not using persistent authentication

API sets jsession id when not using persistent authentication.
This patch creates a session only when persistent authentication
header is passed in the request.

Change-Id: Ieb004fefbd9a276efacb2ce6fa8b7a48a9516c6e
Bug-Url: https://bugzilla.redhat.com/962730
Signed-off-by: Ravi Nori <rnori@redhat.com>