-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I know can store session variables, and retrieve them like this:
// Store
Session sess = Sessions.getCurrent();
sess.setAttribute("Login.Redirect", "/myaccount/myaccount.zul");
// Retrieve
String sLoginRedirect = (String) sess.getAttribute("Login.Redirect");
Is there any way to do this across sessions?
I'm writing an ecommerce application, and I'd like the user to be able to browse the site using http. When they log in, or go to check out, I'd like it to connect to a secure server. My servers will have different names. When the application switches from www.mysite.com to secure.mysite.com, for example, it starts a different session.
I'd like to pass a unique identifier from one session to the other. I know I can do that with either a cookie, or as a parameter in the URL. Is there any other way to do this -- preferably something more elegant, like the session attributes?
Any help or advice would be greatly appreciated!
Nico Metsovon
If you need it across sessions, it will be no longer an session variable but more an application variable right? Session is ment to be just there for the session and not available for other sessions. Application is higher and each session can reach that variable.
For Desktop attributes :
Object o = Desktop.getAttribute(String attributeName);
For application :
WebbApp webapp = Desktop.getWebApp();
Object o = webApp.getAttribute(String attributeName);
For the 2 this is of course also available :
setAttribute(java.lang.String name, java.lang.Object value)
Greetz chill.
I tried to reply to this twice yesterday, but neither reply ever showed up. We'll try it again today...
Yes. You are quite right. What I am asking is, "Is there a way to do something like the session variables at a higher level, such as the Desktop or Application level?"
I've looked and looked, but have not found such a way. Does anyone else know of a way to do this?
Any help will be appreciated!
Asked: 2014-02-11 04:46:59 +0800
Seen: 29 times
Last updated: Feb 12 '14
Controller updating UI every minute
annotation porting from zk 3.6.2 to 6.5.3
How to customize "Processing..." message
JBoss AS 7.1 +Spring+ZK+DHtmlLayoutServlet
Portallayout, portalchildren ordering storage, possible bug
Sniffer Based Monitoring of ZK Apps
The server is temporarily out of service. (syntax error (SyntaxError))