getting cookie on load and after socket connect