惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Cyber Attacks, Cyber Crime and Cyber Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园 - 三生石上(FineUI控件)
博客园 - Franky
博客园_首页
Jina AI
Jina AI
T
Troy Hunt's Blog
V2EX - 技术
V2EX - 技术
雷峰网
雷峰网
云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
有赞技术团队
有赞技术团队
V
V2EX
Google Online Security Blog
Google Online Security Blog
罗磊的独立博客
Attack and Defense Labs
Attack and Defense Labs
博客园 - 聂微东
G
Google Developers Blog
V
Visual Studio Blog
Security Latest
Security Latest
T
Tenable Blog
爱范儿
爱范儿
Know Your Adversary
Know Your Adversary
H
Heimdal Security Blog
博客园 - 司徒正美
K
Kaspersky official blog
The Last Watchdog
The Last Watchdog
酷 壳 – CoolShell
酷 壳 – CoolShell
PCI Perspectives
PCI Perspectives
T
The Exploit Database - CXSecurity.com
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CERT Recently Published Vulnerability Notes
SecWiki News
SecWiki News
宝玉的分享
宝玉的分享
MongoDB | Blog
MongoDB | Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Martin Fowler
Martin Fowler
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Secure Thoughts
Cyberwarzone
Cyberwarzone
量子位
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Project Zero
Project Zero
Blog — PlanetScale
Blog — PlanetScale
L
LINUX DO - 最新话题
IT之家
IT之家

博客园 - zjhgx

hjdang 从jdk11升级到jdk25遇到的问题 腾讯云服务器遭受大量请求攻击导致网页打不开 capacitor的android项目接入穿山甲遇到的坑 class file for org.apache.shiro.lang.util.Nameable not found class file for org.apache.shiro.lang.util.Nameable not found 使用capacitor遇到的问题记录 android真机调试遇到的问题 用java爬取京东商品页注意点 SEO 经验记录 使用goaccess统计nginx日志 nginx日志按天分割 记一次流量爆发导致服务器无响应的记录 mac 安装完Navicat Premium 提示已损坏 无法打开的处理方法 腾讯云问题汇总 vue-element-admin npm install 错误 quasar <q-page>下面<div>自动计算height的问题 Adsense遇到的问题 web项目启动时dubbo报错: No provider available for the service com.davidhu.shopguide.api.service.UserEventService from the url zookeeper ://localhost:2181/org.apache.du quasar ssr模式出现了CLS issue vue ssr里面在template不能出现this,create时this还没有
shiro的cookie去掉domain后导致用户无法登陆
zjhgx · 2025-06-01 · via 博客园 - zjhgx

5月30号在测试app端hjdang的登陆时把shiro sessionManager中的下面这句注释掉了。结果有两个人说现在前端无法登陆。赶紧恢复代码,但发现在我的电脑上edge浏览器可以登陆,但chrome无法登陆。

cookie.setDomain("hjdang.com");
    @Bean
    public DefaultWebSessionManager sessionManager() {
        DefaultWebSessionManager sessionManager = new DefaultWebSessionManager();
        Cookie cookie = sessionManager.getSessionIdCookie();
        cookie.setName("Hjdang");
       // cookie.setDomain("hjdang.com");
        log.info("shiro cookie is {}", JsonUtil.toJSONString(cookie));
        sessionManager.setSessionIdCookie(cookie);
        sessionManager.setSessionDAO(redisSessionDAO());
        sessionManager.setGlobalSessionTimeout(24 * 60 * 60 * 1000);
        return sessionManager;
    }

仔细看了请求,发现islogin这个js方法的请求带的名为 “Hjdang” 的cookie有两个,domain分别为.hjdang.com和web.hjdang.com. 我想是不是后端根据cookie来取session时可能用了web.hjdang.com的,导致找不到session。于是chrome中清除历史的cookie。现在名为 “Hjdang” 的cookie只有一个了,domain分别为.hjdang.com。果然又可以登陆了。