mend session for ajax endpoint