Craft CMS is writing very old cookies which expire in 1969 which are causing, the user to log out everytime when logged in. both the csrftoken and sessionid are given an expiry date of 1969.
i tried using different session methods from db and redis but it still does the same. went throught the file method files it was writing to, of which the files were just created without writing inside the files. i tried writing the cookies outside craft's yii core and it was writing the cookies properly.
craft is expected to write cookies to any of the given methods cookies which haven't expired.