What you see is expected and correct behavior for standard servlet applications.
to enable session sharing you need to add jboss-all.xml to WEB-INF directory of all wars that will be sharing sessions
I already tried this based on your reply on Sharing JSESSIONID across two applications(war) in a wildfly instance But it didn;t work for me. In my case I am not having an ear file containing the wars, both wars are having separate context root. Adding this file didn't change where the cookies are written, Its like
For App1 cookie123 in path /webapps1
For App2 cookie234 in path /webapps2