简体   繁体   中英

javax - getSession returning null

Pretty simple question, request.getSession(true) returns null as if refusing to create a session. I've restarted my machine and added memory to both Tomcat and IntelliJ. Any thoughts or fixes? My coworkers are stumped as it works for them no issue.

Try using getSession(), no arguments, it is in the 2.1 servlet spec

Please refer to https://community.oracle.com/message/2915765#2915765

for more on this.

Please refer to this post https://freddebostrom.wordpress.com/2008/03/13/tomcat-55-getsession-returns-null/

There is a mention about

Based on this post( http://www.mail-archive.com/jetspeed-user@jakarta.apache.org/msg15009.html )

modifying the server.xml configuration file in Tomcat by adding

emptySessionPath="true"

will solve the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM