Method for solving problem of invalid logout of system based on Shiro framework and integrated with Redis

A technology of framework and operation method, applied in the field of system platform based on Shiro framework, can solve problems such as invalid system logout

Inactive Publication Date: 2020-04-03
ZHUHAI HENGQIN SHENGDA ZHAOYE TECH INVESTMENT CO LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The technical problem solved by the present invention is to provide a method to solve the invalid logout of the system based on the Shiro f

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for solving problem of invalid logout of system based on Shiro framework and integrated with Redis

Examples

Experimental program
Comparison scheme
Effect test

Example Embodiment

[0018] Such as figure 1 As shown, the present invention adopts the following steps:

[0019] Step 1: Add Session monitoring to the Session management node in the configuration file, and create Session monitoring object nodes; such as:

[0020]

[0021]

[0022]

[0023]

[0024] Step 2: This creates a listener and implements the Session operation method. The listener implements the SessionListener interface. The operation methods mainly include: Session start, Session end, and Session expiration methods; such as:

[0025] public class ShiroSessionListener implements SessionListener {

[0026] @Autowired

[0027] private RedisSessionDAO redisSessionDAO;

[0028] @Override

[0029] public void onStart(Session Session) {

[0030] }

[0031] @Override

[0032] public void onStop(Session Session) {

[0033] redisSessionDAO.delete(Session);

[0034] }

[0035] @Override

[0036] public void onExpiration(Session Session) {

[0037] redisSessionDAO.delete(Session);

[0038] }

[0039] }

[0040] Step 3. ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention relates to a system platform based on a Shiro framework, in particular to a method for solving the problem that logout is invalid when a system is integrated with Redis. The method comprises the following steps of: 1, adding Session monitoring in a Session management node in a configuration file; 2, creating a monitor and realizing a Session operation method; 3, changing an originallogout filter into an authentication filter in Shiro filtering; 4, creating theauthentication filter and implementing the method; 5, changing the original logout into anonymous access; 6, creating a logout logout method on the control layer; and 7, modifying the logout path of the front-end page to point to a new logout method. According to the method, the problem that a system based on a Shiro framework and integrated with Redis is invalid when logout is carried out is solved.

Description

technical field [0001] The invention relates to a system platform based on the Shiro framework, in particular to a method for solving invalid logout of a system based on the Shiro framework and integrating Redis. Background technique [0002] With the company's business development, more and more users use the system. In order to make the system adapt to large-scale access, the company adopts Nginx cluster deployment and uses Redis as the technical basis for session sharing. However, since the system uses the Shiro permission framework, the logout function uses the logout filter provided by Shiro, which conflicts with the way Redis shares the session. Every time you click logout, the method in the filter cannot be executed. Instead, the page directly displays a 400 error. When the page is refreshed, it is still the same, and it will not jump to the login page. This kind of problem is very bad for users. Every time they log out of the system, they have to close the browser, ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F8/38G06F8/41
CPCG06F8/38G06F8/451
Inventor 陈林张来卿庞严冬
Owner ZHUHAI HENGQIN SHENGDA ZHAOYE TECH INVESTMENT CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products