第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Spring Boot WebSecurityConfig LogoutSuccessURL

Spring Boot WebSecurityConfig LogoutSuccessURL

蝴蝶不菲 2023-09-20 15:20:43
我正在開發(fā)一個 Spring Boot 項(xiàng)目和用于會話控制的 WebSecurityConfig。問題是,當(dāng)會話過期時,我被重定向到/?sessionexpired我期望它應(yīng)該重定向 o 的時候/?expiredsession。此外,當(dāng)用戶注銷時,頁面會重定向到/?sessionexpired而不是/?logout.我的配置如下    @Override    protected void configure(HttpSecurity http) throws Exception {        http            .authorizeRequests()                .antMatchers("/thirdparty/**", "/webjars/**", "/sessionerror").permitAll()                .anyRequest().authenticated()                .and()            .formLogin()                .loginPage("/")                .failureUrl("/?error")                .defaultSuccessUrl("/dashboard")                .permitAll()                .and()            .logout()                .logoutUrl("/logout")                .logoutSuccessUrl("/?logout")                .logoutRequestMatcher(new AntPathRequestMatcher("/logout")) // override default of only allowing POST for logout so we can use a GET                .deleteCookies("remove")                .invalidateHttpSession(true)                .permitAll()                .and()            .sessionManagement()                .maximumSessions(1)                .expiredUrl("/?expiredsession")                .maxSessionsPreventsLogin(false)                .and()            .invalidSessionUrl("/?sessionexpired");    }有人可以幫我解決這個問題嗎?
查看完整描述

1 回答

?
白衣非少年

TA貢獻(xiàn)1155條經(jīng)驗(yàn) 獲得超0個贊

所以我最終想通了。它正在重定向,/?sessionexpired因?yàn)樵谧N時我通過將其設(shè)置為 true 來使Session失效。我應(yīng)該將其設(shè)置為 false,然后用于.deleteCookies("JSESSIONID")使會話無效。這樣它就會正確重定向。



查看完整回答
反對 回復(fù) 2023-09-20
  • 1 回答
  • 0 關(guān)注
  • 98 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號