0

Redirect and remove current session

asked 2016-12-14 14:29:33 +0800

FlorianSchaetz gravatar image FlorianSchaetz flag of Germany
31 6

updated 2016-12-14 14:33:49 +0800

Hello,

perhaps someone got an idea: How can I force ZK to remove the current session and load a page (on the same server/domain) with a new one? I store a lot of data in the session and keeping it there when loading the new page would effectively pollute that new page, so I'm looking for a way to "redirectAndForgetSession"...

Calling invalidate() on the session and then sendRedirect in a click-listener doesn't work.

Little detail: I use session identification via url (single-page-application, iframe, cross-domain... long story) and so the resulting url I get for the redirect looks like /index.zul;jsessionid=... - when removing that jsessionid manually from the link, it works, but I cannot stop ZK from adding it automatically. Preventing that could solve my problem as well.

Regards,

Flo

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-12-14 18:11:37 +0800

FlorianSchaetz gravatar image FlorianSchaetz flag of Germany
31 6

Ok, found one solution myself: When using an absolute link ( http://...) instead of a relative one ( /... ), ZK doesn't seem to attach the jsessionid to it, which pretty much solves my problem since without the jsessionid nothing bad happens.

link publish delete flag offensive edit
1

answered 2016-12-14 17:47:17 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

Hey Flo,

Maybe some easier solution is there.

Put in your session a Map<String,Object> as object.
Then store all the "pollution" data in there.

Calling new page => just put a new Map into the session or clear the map and your done.
Saves also all the code of invalidating and recreating a new Session.

Greetz chill.

link publish delete flag offensive edit

Comments

Sounds like a great idea in any case, thanks, will do.

FlorianSchaetz ( 2016-12-14 18:11:58 +0800 )edit
Your answer
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
1 follower

RSS

Stats

Asked: 2016-12-14 14:29:33 +0800

Seen: 40 times

Last updated: Dec 14 '16

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