• Post Reply Bookmark Topic Watch Topic
  • New Topic

session for HTTP AND HTTPS  RSS feed

 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
Just wanted to know whether the HttpSession for
HTTP and HTTP are the same. What I mean is - Suppose I change the protocol from HTTP to HTTPS will I be able to access the info stored in the previous Httpsession (created when the protocol was HTTP).
 
Paul Anilprem
Enthuware Software Support
Ranch Hand
Posts: 3954
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you will not be able to do that. The first time you use an HTTPS url, the container will create a new session.
What you can probably do is, put the session associated with the HTTP part into the servlet context (sessionid-session pair) and pass the sessionid with the https url as a parameter. Use that sessionid to get the original session. I have not done this before so I am not sure whether it is the best way to do it though.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!