Session transfer to prevent loss

 

Session transfer to prevent loss

http://blog.csdn.net/tangruyi1992/article/details/52368797

 

Now the general LB server has the corresponding session transfer function

The client stores a cookie, and the server synchronizes their respective sessions to achieve session sharing, and the transfer session is not lost

Server session--send sessionid to browser--browser saves sessionid in cookie

 

1. When using cas, the shiro authentication is handed over to cas. When transferring the service, cas will reversely generate the session according to the client's cookie and put it into the server (cas has its own session storage class, which is stored in the cas service memory)

2. When using redis directly, it is 1, turn on remberme, 2, and copy shiro's session manager to get it from redis

See before and after blog for detailed implementation

 

Require:

1 Global HTTP Session ID (to ensure that different jvms are not repeated)

2,

  2.1 Database backup

  2.2 Memory Backup

   2.2.1 Copy the backup to all other server memory (large network communication requirements)

   2.2.2 Equivalence assignment between servers

   2.2.3 Use a dedicated server memory session, which is shared with other services

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326398972&siteId=291194637