Using cookies storage on Next.js app with Amplify Auth

I am currently creating a website with Next.js where I am using Amplify to authenticate my users. But the problem is that Amplify stores user’s session including tokens on browser’s localStorage which I think is not secure.

Is it more secure to use cookiesStorage instead and how can I configure Amplify to store user’s session in cookiesStorage