you said
I thought I could create a long random key (token), which is generated during registration in any application and passes a request in each network for any application to identify the registered user, but this does not seem safe.
But essentially how sessions work.
Itβs best to create a unique login ID (as you said), store it in a database cache or cache accessible by both applications, and find a way to save it so that both web applications can retrieve it.
If both applications are in the same root domain, you can use a cookie with an empty file installed on / so that both applications can access it.
If both applications are in a different root domain, this will be a bit more complicated.
Regarding the security associated with the transmission of an identifier token, you can restore the identifier for each request that protects against swapping cookies.
source share