0

SESSION invalidate

asked 2006-08-18 15:16:55 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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.

delete flag offensive retag edit

8 Replies

Sort by ยป oldest newest

answered 2006-08-21 14:48:34 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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)



link publish delete flag offensive edit

answered 2006-08-21 14:49:10 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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

link publish delete flag offensive edit

answered 2006-08-21 15:47:55 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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);"/>

link publish delete flag offensive edit

answered 2006-08-22 23:48:35 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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.

link publish delete flag offensive edit

answered 2006-08-23 07:07:03 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3880302

By: henrichen

Post to Bug list along with a example code.

link publish delete flag offensive edit

answered 2006-08-23 08:47:40 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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.

link publish delete flag offensive edit

answered 2006-08-23 09:24:35 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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>

link publish delete flag offensive edit

answered 2006-08-28 23:43:16 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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 :)

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2006-08-18 15:16:55 +0800

Seen: 1,050 times

Last updated: Aug 28 '06

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More