How to set a scope for sessions
I need to create a session to store my object in it and I need it to be avalable ONLY on the same computer!!!
I have the following:
jsp1
MyObject obj = (MyObject ) request.getSession().getAttribute("MyObject ");
request.getSession().setAttribute("MyObject ", obj);
in jsp2
MyObject obj=(MyObject)request.getSession().getAttribute("MyObject ");
now if several users work at the same time they get objects(in jsp2) , last created by another user (in jsp1).
[512 byte] By [
bnew] at [2007-11-25 21:25:30]

# 1
Are you accessing these pages using the authlessanonymous user? If so, then this behavior would be expected since there is only one session that is shared for all users accessing the portal. To remedy this you can make one of these changes:
1) You can change the authlessanonymous to plain anonymous. This is not as efficient, but it does create a new session for each anonymous user.
2) Require users to login with a user id and password
3) Utilize the PAPI call ProfileProviderAdapter.setClientProperty(). This will set the value as part of the session cookie that is sent to the client. The restriction here is that you can only store strings.
- Jim
# 2
Are you accessing these pages using the authlessanonymous user? Yes , that's true we set authlessanonymous as default user !!thanks a lot!could you also explain why it's not efficient ? ... and where in SUN docs I can read more o this subject.
# 3
To be clear, there are basically three ways to access the portal:
1) authlessanonymous: This method does not require a user to login. Furthermore, only one "session" is created for all anonymous users that are accessing the system. Therefore, it is not appropriate to store user-specific information in the session object when using authlessanonymous. However, the advantage of this is that it is extremely efficient. Obviously, sessions incur a certain amount of overhead and the ability to consolidate anonymous access to a single session reduces the load on the system and increases scalability.
2) anonymous: Notice the lack of "authless" here. In this case, a new session is created for every anonymous user accessing the system. In a large deployment, this will result in a lot of overhead in the system and reduce the overall scalability of the portal. The advantage of this configuration is that you can store user-specific information in the session.
3) Registered User: In this case, known users log into the system. This also creates a new session for each user. In this situation you can also store information in the user's display profile within the directory server. Users can customize their desktop and have a much more personalized experience with the portal.
The typical use case is that most access is done anonymously. Not all users will log into the portal. You want to minimize the impact that anonymous access has on the system. Users that log into the portal will have their own customized portal desktop and also have access to their own session. This creates a more personal experience for users that log into the portal.
Please read this for more information:
http://docs.sun.com/source/819-4154/dsameadm.html#wp27343
# 4
Unfortunatelly this seems not help with the problem!!!I made 1 anonymous is a default user now 2 authlessanonymouse is Inactive nevertheless ... there is only one session created, which can be access by all anonymouse users!!!
bnew at 2007-7-4 23:56:13 >

# 5
Please help everyone who knows !!!
I understood that if I set authlessanonymous user as default, it will not ask password to get on my site, but it also creates for each form only ONE SINGLE SESSION for all authlessanonymous users so they will see each other!!! whcih I do not want
If I set anonymous as default user , it asks EVERY user to log in to portal!!! which I also do not wnat!!!
I need the following:
1 the portal should be available for every one, login/pass required
2 if one visitor wants to fill up the form, I want it to be new session , so there will be no mess with other users working with the same form.
bnew at 2007-7-4 23:56:13 >

# 6
Please help everyone who knows !!!
I understood that if I set authlessanonymous user as default, it will not ask password to get on my site, but it also creates for each form only ONE SINGLE SESSION for all authlessanonymous users so they will see each other!!! whcih I do not want
If I set anonymous as default user , it asks EVERY user to log in to portal!!! which I also do not wnat!!!
I need the following:
1 the portal should be available for every one, no login/pass required
2 if one visitor wants to fill up the form, I want it to be new session , so there will be no mess with other users working with the same form.
bnew at 2007-7-4 23:56:13 >
