*
The moose likes Servlets and the fly likes session lost when including another file from another server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "session lost when including another file from another server" Watch "session lost when including another file from another server" New topic
Author

session lost when including another file from another server

Artemesia Lakener
Ranch Hand

Joined: Jun 21, 2005
Posts: 162
Here is my code:

<base href="http://server_A/">
<jsp:include page="/html/page1"/>
<base href="http://<%= req.getServerName() %>"/>

<FORM action=/app/submit" method="POST">
..
</FORM>

I found that ---

If I directly hit "continue" button to go to next page, the next page gets the same session id as the first page; but if I hit "refresh" button on this 1st page, then the next JSP page will get a different session ID, but this only happens once, after that the next page always gets that session id and won't change any more.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Server is treating that refresh action as a brand new request from a new user. If you refresh some other page it should not happen. It is making a new sesson upon refreshing the first page may be because your first page is a welcome page.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: session lost when including another file from another server
 
Similar Threads
URL rewriting
jQuery AJAX display issue
Speed up Application Created USing Servlets and JSP
Simple jsp:useBean question
jsp:include in JSF JSP