how can i do sessions in java if some one disables cookies in my browser?

前端 未结 8 1499
长发绾君心
长发绾君心 2020-12-09 12:58

I like to know if someone disables the cookies in my browser then cookies dont work for my browser then how can I do sessions in java. I am writing servlets for server side

8条回答
  •  不思量自难忘°
    2020-12-09 13:44

    If cookies are disabled, you can still maintain sessions by sending the value of JSESSIONID as a query parameter, like:

    http://www.mywebsite.com/somePage?JSESSIONID=389729387392
    

    Keep in mind that if security is a primary concern then you may not want to use this approach, as it puts the session id right into the url.

提交回复
热议问题