Re: WOA, Building a Login form
Re: WOA, Building a Login form
- Subject: Re: WOA, Building a Login form
- From: Ondra Cada <email@hidden>
- Date: Mon, 4 Apr 2005 00:20:11 +0200
Drew,
On 3.4.2005, at 23:58, Drew Thoeni wrote:
I have an object in the session called currentUser. I set this to the
user fetched from the database (see snipit below). On logout, I
nullify that object. Again, there may be a better way.
There is... in a sense. Since the more complicated the application, the
more probable the session may contain some user's important data, it's
better to kill the session instead.
Myself, I tend to use something like this (with the very same
disclaimer: there may be much better way still :))
public WOComponent logout() {
session().terminate();
WORedirect wor=new WORedirect(context());
wor.setUrl(context().directActionURLForActionNamed("default",null));
return wor;
}
And, I have an outstanding question to myself whether this is just
making a reference, or really copying the data.
Uh-oh? *All* Java objects are references, if that's what we are
speaking of. To copy one, you have to do that manually (like by using
the clone method).
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden