private void WriteExisting(IResponse response, RawSession session, DateTime expirationDate) { if (session.IsEmpty()) { UnsetCookie(response); } else { SetCookie(response, session, expirationDate); } }
private void WriteNew(IRequest request, IResponse response, RawSession session, DateTime expirationDate) { var isSessionEmpty = session.IsEmpty(); if (!isSessionEmpty) { SetCookie(response, session, expirationDate); } else if (RequestHasSessionIdCookie(request)) { UnsetCookie(response); } }