closing/ending a session in jsp

Hi guys i need help ending my session. I am using session just for parameter passing, my webpages doesnt need login logout function.

These are my basic code:

page1.jsp

<%

String prodlinesel = request.getParameter("prod_line");

session.setAttribute( "sessprodline", prodlinesel );

%>

page2.jsp

<%= session.getAttribute("sessprodline") %>

how,when &where do i end my session ? thanks so much

[469 byte] By [Btreksuna] at [2007-10-3 2:31:23]
# 1
You can use session.removeAttribute("sessprodline");Calling session.invalidate() will invalidate the session.Otherwise it disappears after it times out - normally after about 30 minutes of inactivity from that session.
evnafetsa at 2007-7-14 19:30:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
thanks evnafets , but when do i end the session ? when the user close the browser ? or is it safe if i just let timeout , no need to end the session ?
Btreksuna at 2007-7-14 19:30:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Yes.. U need not worry regarding the session when the user closes the browser ..since server cannot find out if borwser was closed. So the session will expire automatically during timeout.
RohitKumara at 2007-7-14 19:30:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
thanks alot Rohitkumar
Btreksuna at 2007-7-14 19:30:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...