When is the SessionId of Shiro set to the client?

< H2 > scene < / H2 >

when using Cors for cross-domain login, everything is fine, but the client does not add SessionId ( Cookie inside), so it is not clear what happened.

call js code:

<!--cors -->
<filter>
  <filter-name>customCorsFilterConfig</filter-name>
  <filter-class>CustomCorsFilterConfig</filter-class>
</filter>
<filter-mapping>
  <filter-name>customCorsFilterConfig</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>

however, after the normal request ends, SessionId is not set in cookie on the client side. Why? "(_;)"

Apr.05,2021

shiro registers things like filters to do this, so session id is not web container in charge.


now the problem is solved, or the client request is not set correctly. As long as you need to bring / return authentication information , you must add the parameter credentials .

the request now looks something like this:

fetch('http://localhost:8089/test/setSession', {
    credentials: "include"
})
    .then(res => res.json())
    .then(json => console.log(json))
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea8feb-1f1e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea8feb-1f1e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?