I am trying to implement authentication in my Next.js application. I have tried using NextAuth.js but I am facing issues with the session management. Can someone help me understand how to properly set up authentication?