request.getRequestedSessionId() = null

The XLogin.java servlet works to retrieve a session because it was already been created. We log the session's details, as shown the session.getId() = 6718DB50C2384D1E039F8F09F13C77B3, but the request.getRequestedSessionId() = null. So, when the next action is submitted a new session is created having the value of request.getRequestedSessionId() not equal to null and similar to session.getId().

How can I make the request.getRequestedSessionId() = session.getId() to keep the first session created be used through the rest of the transaction of a user.

Thanks,

Ariel

[594 byte] By [Ayie004a] at [2007-11-26 16:09:59]
# 1

The server doesn't create a new session everytime a user does a new action, why would it do that, thats why we have in the web.xml

<session-timeout>

30

</session-timeout>

The server has some way of keeping the track for each user, probably using cookies, because the HTTP protocol is stateless. You dont have to worry about that.

MeTitus

Me_Titusa at 2007-7-8 22:32:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

have you looked at the JavaDocs for getRequestedSessionId()?

"Returns the session ID specified by the client. This may not be the same as the ID of the current valid session for this request. If the client did not specify a session ID, this method returns null."

http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletRequest.html#getRequestedSessionId()

I don't think it does what you are looking for.

tolmanka at 2007-7-8 22:32:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...