-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3873824
By: jim_pang
Hi..
I want ask a question about session.invalidate()
Let assume we have login.zul where we input user and password. Before we log in, zul already give us session, rite? and after log in and do something, and we want to log out. then we invalidate the session, rite? and we go again to login.zul, but how we retrieve a new session?
thx.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3877419
By: jim_pang
it always throw
java.lang.IllegalStateException: getAttribute: Session already invalidated
>> at
>>org.apache.catalina.session.StandardSession.getAttribute(StandardSessi
>>on.j
ava:993)
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3877420
By: jim_pang
and I have to restart the server
pls help
thx
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3877522
By: tomyeh
After invalidating a session, you generally ask the browser to redirect to another page. The following is an example to redirect back the same page.
<button label="c" onClick="session.invalidate(); Executions.sendRedirect(null);"/>
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3879964
By: jim_pang
after invalidating session, I couldn't enter into the system before restarting the server.
Even with a new browser.. is it bug?
thx.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3880302
By: henrichen
Post to Bug list along with a example code.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3880477
By: nobody
I couldn't post the example.. if the session is invalidated then we should restart the server. If else, we would not be able to get a valid session.
thx.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3880514
By: henrichen
Here is the code that I test the session invalidation.
1. enter "ABC" in session value textbox.
2. push "save into session"
3. push "fetch from session and show on the label", and it show "ABC".
4. push "invalidate session" and the page load.
5. push "fetch from session and show on the label" and nothing shown.
Everything is as expected. I am not sure what's wrong with your case.
<window id="main" title="hello" border="normal" width="300px"> Session value:
<textbox id="txuser"/>
<label id="lbuser"/>
<button label="save into session" onClick="session.setAttribute("user",
txuser.getValue())"/>
<button label="fetch from session and show on the label"
onClick="lbuser.setValue(session.getAttribute("user"))"/>
<button label="clear the label" onClick="lbuser.setValue(null);"/>
<button label="invalidate session" onClick="session.invalidate(); Executions.sendRedirect(null);"/> </window>
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3888312
By: jim_pang
Hi Henry, thx for the helpful example. I did trace my code and found where's the error.. I put the session into static, and forgot to invoke getcurrentsession..
so it's always invalidated.
thx a lot and sorry for that henry.. don't be tired to help us :)
Asked: 2006-08-18 15:16:55 +0800
Seen: 1,061 times
Last updated: Aug 28 '06