JSP sharing session among users

Hey all,
I got a simple but important problem to pass by you all.
:-) I wrote an intranet application using jsp and servlets. The issue I found is at login, the userid displayed is from a prior session. For example, I login in the morning and then leave. Another user logs in in the afternoon and sees the userid field with my userid.
I thought I would keep the value of the userid for each user, but it seems the server is keeping the session. I store the userid in a hash table and then store it in a HttpSession and pass the hash table around (much like a context). I thought HttpSession was unique for every user, so I figured GC would take out the prior session along with the data contained in it. Any ideas?
I am in QA now and hope to be implemented by Tuesday. What I did to clear out the userid field was to remove the code that preloads that field from the session. It works, but it concerns me that maybe other data might be shared.
Thanks,
Patrick

Session's are not shared across users. Actually
sessions are mainitained by a variety of ways and one
of the ways is cookies in the browser.
If i understand you right , this problems occurs in
the same machine and may be same instance of the
browser.
You might need to do the following...........
1) Make the settings in your app server so that the
session expires after some time. The session should
not be active for ever.=== The session does time out after 30 minutes.
2) Second is that have a login page and in that page
always clean the session variable.=== I get the session from request.getSession(). Do === you call invalidate() on the HttPSession object to === initialize it or just session = null?
3) Further make sure that none of the variable you use
in the JSP is in application scope ie
<%!
int session_id
%>
In this example this variable is in application scope
outside the jspservice function. And since the
servlet(ie jsp) is called in multiple threads , you
will get into the whole issue of synchronization and
stuff. So be care about this scope ...
=== I know I don't use session ids. I see the need for === them, but not in the scope of this app.
I think this would solve the problem.Thanks,
Patrick

Similar Messages

  • Use Sparse Bundle Disk Image for sharing library among users?

    Apple's knowledge base article HT1198 (http://support.apple.com/kb/HT1198) on sharing iphoto libraries among multiple users on the same Macintosh describes using a sparse disk image in the /users/Shared/ directory. For a Mac that uses a Time Capsule for Time Machine backups won't this require the entire iPhoto library to be backed up anytime a picture is added or modified?
    Would using a sparse bundle disk image instead work better?
    Also, HT1198 doesn't say anything about "Partitions" parameter setting in Disk Utility when creating a blank sparse image or sparse bundle disk image. Does it matter what setting is selected if the image is being kept on the Mac internal disk drive?
    Is there any difference between iPhoto '08 or iPhoto '09 when attempting sharing the iPhoto library among users?

    I believe it may require the entire bundle to be backed up. You'd best ask that question in the Time Machine forum. They would know more about the ins and outs of TM there.
    If you can afford an external FW hard drive that would be the best option by far. No worry about filling up the sparse bundle, and you could use the external HD as a work platform to help keep a minimum of 20 GB of free space on your boot drive for optimal performance of system and applications.

  • Sharing pics among Users on same computer

    I want to share the pictures on our MacBook between my wife and me. Each of us has a User account on this machine. I have stored the pictures in the Shared Folder, and would like to reference the pictures from each of our User accounts using iPhoto. However, IPhoto was set to the management default, so it duplicated all the pictures, and they now exist both in Shared and in My Pictures.
    I need advice: am I trying too hard to be efficient by having the pictures in only one place? Should we go ahead and duplicate everything - it seems wasteful, and has the potential for confusion. What do you think?
    Thanks, S

    Two Problems and two solutions:
    I have stored the pictures in the Shared Folder... iPhoto was set to the management default, so it duplicated all the pictures,
    Chuck away the ones in the Shared Folder - put them in the trash. Just don't empty it yet, until you're sure that the Library does indeed contain all the Photos.
    would like to reference the pictures from each of our User accounts using iPhoto
    For iPhoto 09 (version 8.0.2) and later:
    What you mean by 'share'.
    If you want the other user to be able to see the pics, but not add to, change or alter your library, then enable Sharing in your iPhoto (Preferences -> Sharing), leave iPhoto running and use Fast User Switching to open the other account. In that account, enable 'Look For Shared Libraries'. Your Library will appear in the other source pane.
    Any user can drag a pic from the Shared Library to their own in the iPhoto Window.
    Remember iPhoto must be running in both accounts for this to work.
    If you want the other user to have the same access to the library as you: to be able to add, edit, organise, keyword etc.
    Quit iPhoto in both accounts. Move the Library to the Users / Shared Folder
    (You can also use an external HD set to ignore permissions, a Disk Image or even partition your Hard Disk.)
    In each account in turn: Double click on the Library to open it. (You may be asked to repair the Library Permissions.) From that point on, this will be the default library location. Both accounts will have full access to the library, in fact, both accounts will 'own' it.
    However, there is a catch with this system and it is a significant one. iPhoto is not a multi-user app., it does not have the code to negotiate two users simultaneously writing to the database, and trying will cause db corruption. So only one user at a time, and back up, back up back up.
    Regards
    TD

  • Shared applications among user profiles?

    My wife and I have separate user profiles for our home computer. When I upload photos she can not access them from iPhoto unless she is logged in to my profile. The same is true for me if she uploads photos.
    Is there a way for us to have a universal or shared applications (at this time, specifically iPhoto) across multiple profiles?

    What you mean by 'share'.
    If you want the other user to be able to see the pics, but not add to, change or alter your library, then enable Sharing in your iPhoto (Preferences -> Sharing), leave iPhoto running and use Fast User Switching to open the other account. In that account, enable 'Look For Shared Libraries'. Your Library will appear in the other source pane.
    Any user can drag a pic from the Shared Library to their own in the iPhoto Window.
    Remember iPhoto must be running in both accounts for this to work.
    If you want the other user to have the same access to the library as you: to be able to add, edit, organise, keyword etc. The problem here is that OS X works very hard to keep your data safe and secure from the other users. You're trying to beat what's built in to the system. So, to beat the system
    Quit iPhoto in both accounts
    Move the iPhoto Library Folder to an external HD set to ignore permissions. You could also use a Disk Image or even partition your Hard Disk.
    In each account in turn: Hold down the option (or alt) key and launch iPhoto. From the resulting dialogue, select 'Choose Library' and navigate to the new library location. From that point on, this will be the default library location. Both accounts will have full access to the library, in fact, both accounts will 'own' it.
    However, there is a catch with this system and it is a significant one. iPhoto is not a multi-user app., it does not have the code to negotiate two users simultaneously writing to the database, and trying will cause db corruption. So only one user at a time, and back up, back up back up.
    Lastly: This method seems a little clunky at first, but works very well. Most importantly, it uses the System to do the job for you.
    Create a new Account on your Mac, call it Media. Create an iPhoto Library there. (BTW: This will work for iTunes too.)
    Enable Sharing on the Library:(Preferences -> Sharing), leave iPhoto running and use Fast User Switching to open the other accounts. In those accounts, enable 'Look For Shared Libraries'. The Library will appear in the other source pane.
    This means that both users will be able to see the pics. If you want to use a pic then simply drag it from the shared Library to your own in the iPhoto Window. This means that each user can have their own edits.
    If you want to add photos to the Library: Log into the Media account for that purpose.
    To make it all seamless: Set your Mac to log into the Media Account automatically. Set iPhoto to launch on log-in. Then switch to your own account using Fast User Switching.
    Net result: a Library that's permanently available to all users but also protected. Each user can have their own versions of the pics if they want.
    No partitioning, no permissions issues. Uses no extra disk space. What's not to like?
    Regards
    TD

  • Sharing apps among users

    can we share applications on a mac between users

    Most applications are already shared between users.  They're located in the common system applications directory.

  • Sharing XML packages among users

    Hello all,
    I have a question about the installation of the Oracle XML packages and sharing them among users.
    Our DBA thought it might be best to create a special user (user1) and install all of the XML packages, utilities under that user schema. We went this route and were trying to use that users's xml objects with another user (user2).
    When trying to generate XML output from SQL using the xmlgen package as user2 we get the following error.
    SQL> set serveroutput on size 1000000
    SQL> DECLARE
    2 v_query VARCHAR2(200) := 'SELECT ''monkey'' AS Animal FROM dual';
    3 BEGIN
    4 DBMS_OUTPUT.PUT_LINE(DBMS_LOB.SUBSTR(xmlgen.getXML(v_query), 250, 1));
    5 END;
    6 /
    DECLARE
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: java.util.MissingResourceException:
    can't find resource for oracle.xml.sql.mesg.XSUMessages_en_US
    ORA-06512: at "SXXML.XMLGEN", line 465
    ORA-06512: at "SXXML.XMLGEN", line 456
    ORA-06512: at line 4
    However running that same anonymous PL/SQL block as user1 we get success:
    SQL> set serveroutput on size 1000000
    SQL> DECLARE
    2 v_query VARCHAR2(200) := 'SELECT ''monkey'' AS Animal FROM dual';
    3 BEGIN
    4 DBMS_OUTPUT.PUT_LINE(DBMS_LOB.SUBSTR(sxxml.xmlgen.getXML(v_query), 250, 1));
    5 END;
    6 /
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <ANIMAL>monkey</ANIMAL>
    </ROW>
    </ROWSET>
    So I have several questions:
    1> What is the best way to install these XML packages so that all users can use these utilities?
    2> What access privileges need to be granted to user2 so that user1 AML utilities are available?
    Thanks in advance.
    Regards,
    Bediako George

    Thanks for the quick reply Steve: I have an observation and a couple of questions.
    First my observation. I looked for the java resource that "turned up missing" as far as my user2 user is concerned and I couldn't find it in sxxml's schema. ( I was logged in as sxxml). I attempted to create a wrapper package belonging to sxxml sxhema as I understood. However even after granting execute privilege to my second user I got the same message.
    Finally I removed the authid as current_user tag from the package declaration and I was able to get it to work.
    I am not comfortable with this solution and would like to get this set up the right way. You said my second option was to grant execute privilege on the missing Java resource to my second user.
    How do I locate this "missing" Java resource?
    How do I grant execute privilege to a Java resource?
    What are the ramifications of solving the problem the way I did?
    Thanks again for your help.
    Regards,
    Bediako
    create or replace package xmlgen AUTHID CURRENT_USER...This means that it runs under the security domain of whatever user executes it, not under the security domain of the package owner/definer.
    Either GRATN EXECUTE on this Java resource to your new user, or alternatively, have your SXXML schema create a wrapper package for XMLGEN that is created using the default of definer's rights. Then, anyone that you GRANT EXECUTE to your wrapper procedure can use it.<HR></BLOCKQUOTE>
    null

  • Sharing portlet preferences among users

    Hello,
    Is it possible to share portlet preferences among users? So that the
    portlet preferences would be stored per portlet instance, and would be
    the same for every user?
    If this is not possible with Java portlets (JSR-168), can it be done
    with other portlet types (JSP portlet, page flow portlet), using the
    PortletPreferences API?
    The JSR-168 specification says:
    "Portlet Specification assumes preference attributes are user specific,
    it does not make any provision at API level or at semantic level for
    sharing preference attributes among users. If a portal/portlet-container
    implementation provides an extension mechanism for sharing preference
    attributes, it should be well documented how the sharing of preference
    attributes works."

    Betsy,
    Does WLP provide a way to allow a user to store only a subset of all
    his portlet preferences (using only JSR 168 api) ?
    My aim is to try to create a JSR 168 compliant portlet where few of
    the preferences are allowed to modified by the user (in the edit
    mode), while all other preferences may be modified only by a portal
    admin (thru admin view). However, the PortletPreferences.store()
    method seems to store values of all current preferences for the
    particular user, with the result that future changes by the admin are
    not reflected for any user who has already customized his
    preferences.You can let the admin propagate changes to the user via admin tools.
    There is an option in admin tools to do that.
    Setting the preference <read-only> attribute to 'true' does not help
    either, as the store method still attempts to store the value and
    then throws a ReadOnlyException.In this case, the setValue/setValues/reset and not the store will throw
    the ReadOnlyException.
    Why does WLP attempt to store all preference values; as opposed to
    setting only those which have been explicitly set using
    PortletPreferences.setValue(key, value)?The implementation does not keep track of changes explicitly in memory.
    Even if it keeps track of changes, I'm not sure if this would solve your
    use case.
    Will BEA be changing this in future releases, and is there a
    work-around for now?The suggested approach is to let admins propagate changes to users.
    Subbu
    >
    Thanks, Betsy
    Although WLP does not support the notion of sharing preferences,
    WLP lets you manage preferences in a hierarchy via the admin tools.
    When an admin sets preferences on a portlet, as long as users don't
    customize their portlets, all users get the same portlet instances,
    and hence share preferences.
    Subbu
    Bob said the following on 02/12/2004 04:08 AM:
    Hello,
    Is it possible to share portlet preferences amongusers? So that the
    portlet preferences would be stored per portletinstance, and would be
    the same for every user?
    If this is not possible with Java portlets(JSR-168), can it be done
    with other portlet types (JSP portlet, page flowportlet), using the
    PortletPreferences API?
    The JSR-168 specification says:
    "Portlet Specification assumes preferenceattributes are user specific,
    it does not make any provision at API level or atsemantic level for
    sharing preference attributes among users. If aportal/portlet-container
    implementation provides an extension mechanism forsharing preference
    attributes, it should be well documented how thesharing of preference
    attributes works."

  • Sharing Music files on the same Mac among user profiles

    How can I share music among user profiles on the same Mac? I have an itunes account for me but I don't want my kids to have one yet. So, I want to download music but then share some music files for their itunes on their profile. The Home sharing feature only discusses sharing among different computers on the same network.

    Check out:
    http://support.apple.com/kb/ht1203
    http://www.macosxhints.com/article.php?story=20090219133314985
    and:
    http://steve-on-sakai.blogspot.com/2009/07/really-sharing-your-itunes-library.ht ml

  • Issues Using iPhoto among users on Shared profile

    Hi there,
    I am having issues viewing my photos from multiple user profiles. I have the library saved on a shared profile, and I (admin) can see all photos fine, however my wife can see events and thumbnails, but cannot view the photos individually - she gets just black space where the photo would be. Has anyone else encountered this? Any ideas?

    I'm not sure what this means:
    I have the library saved on a shared profile,
    Are yu sharing the Library via iPhoto Preferences? Or Sharing by both users pointing at one Library?
    For iPhoto 09 (version 8.0.2) and later:
    What you mean by 'share'.
    If you want the other user to be able to see the pics, but not add to, change or alter your library, then enable Sharing in your iPhoto (Preferences -> Sharing), leave iPhoto running and use Fast User Switching to open the other account. In that account, enable 'Look For Shared Libraries'. Your Library will appear in the other source pane.
    Any user can drag a pic from the Shared Library to their own in the iPhoto Window.
    Remember iPhoto must be running in both accounts for this to work.
    If you want the other user to have the same access to the library as you: to be able to add, edit, organise, keyword etc.
    Quit iPhoto in both accounts. Move the Library to the Users / Shared Folder
    (You can also use an external HD set to ignore permissions, a Disk Image or even partition your Hard Disk.)
    In each account in turn: Double click on the Library to open it. (You may be asked to repair the Library Permissions.) From that point on, this will be the default library location. Both accounts will have full access to the library, in fact, both accounts will 'own' it.
    However, there is a catch with this system and it is a significant one. iPhoto is not a multi-user app., it does not have the code to negotiate two users simultaneously writing to the database, and trying will cause db corruption. So only one user at a time, and back up, back up back up.
    Regards
    TD

  • Session backing beans and multiple navigator windows sharing session

    Hi let's suppose i have a web and page1, page2 and page3 that should share the backingbean. Normal navigation goes from page 1 to page 2 to page 3.
    I do not want a backing bean per page because i need to share data between my pages. The immediate solution is to put this bean in session context and use it in each page. But this has severe drawbacks:
    - The backing bean is the same each time I access any page, and I want a new bb to be used each time the user requests for page 1
    - When a user has more than one navigator window sharing session, and on each window he is navigating through pages 1 to 3, there can be a big mess because he is accessing to the same bb from both windows.
    So I would like to find a solution that permit the user to navigate from both windows as if the windows had its own session.
    Any hint?
    Thnx

    I have a similar problem as described .
    I hava one window with enterable fields and when you click on a button it opens another window .Both forms are backed by the same bean .since both forms are nearly the same .
    The bean is a managed bean in request scope .
    when I fill in the first window with values and click on the link it opens the second but the first windows elements and now empty .
    Even though it is in Request scope when the second window is being loaded the bean is re-initialized . I would expect a new intance of this bean to be created for the second window .
    This is how I am calling the second window .
    <h:commandButton id="newRequestItem" action="#{requestItem.createNewRequestItem}" rendered="#{createActivationRequest.displayCreateLinks}" onclick="openNewPage('NewRequestItem.jsp');"
    image="images/show_all.gif" title="new request">
    <h:outputText value="new request" styleClass="toolbar-command"></h:outputText>
    </h:commandButton>
    function openNewPage(url)
         aqcbwin= window.open(url, "newRequestItem","toolbar=no, scrollbars=1");
    aqcbwin.moveTo(50, 50);
    target="_new";
    //target="_blank";
    aqcbwin.focus();
    any ideas to what is wrong and how I can correct this .
    Thanks for your help .
    Mark

  • Login JSP losing Session

    I have a Login JSP which talks to a Servlet which then passes the login request to a Bean. In the Bean I save the login information in the Session, if the login fails I am trying to 'forward' to the Login JSP page again. On the Login JSP there is an 'errorText' field that gets the errorText Property from my Bean. However, when the 'getErrorText' method is called by the JSP I seem to have a new Session and have lost all of my login information.
    What have I done wrong ? I have tried setting the 'scope' of the Login JSP to session and the application but with no result.
    How can I ensure that when I re-display the Login JSP with an error message on it that I am using the Session (and copy of my bean) that I had when I set the properties ?
    Sarah.

    have the code for setting the session values in the servlet that comes after the JSP login page.
    in the jsp login page try to retreive the session values for the user name and the password.
    store these values in the name and password variables.
    for the first time it'll be null and an exception will be thrown. so in the catch block, set the value of the name variable and the password to null string ie "" and set these values as the values of the textfields (for user name and password). also in the catch block, set the error message string also . this one u can use to display when u r redirected to the JSP login page by the servlet. if first time, then set it to null string "".
    but assuming that the JSP page has been called from the servlet when an error occured i.e when the server cannot recognize the user name and password combination, the session variables for the user name and the password won't be null and u can use these values to be displayed in the respective textfields.
    so when the user name and password cannot be recognized by the server, just call the same JSP login page.
    hope that clears a bit of ur doubt!!
    rgds
    JP

  • Photo Sharing in Separate User Profiles

    I have created separate user profiles for my wife and me on our new iMac. I'm returning to Mac after time away, and I cannot remember whether there is a way for us to share the same photos in each separate profile. Thoughts?

    iPhoto: Sharing libraries among multiple users...
    http://support.apple.com/kb/HT1198

  • What would cause adobe connect to freeze in a session for users, while the moderator session did not

    what would cause adobe connect to freeze in a session for users, while the moderator session did not

    HI rogerstam1
    Is screen being shared at that time when addin freezes?
    if yes if this coems again could you just stop screen share and try it again.
    hope this helps.

  • Clustered WL 6.1 creates 2 server sessions per user

              It appears that WL 6.1 creates 2 HTTP sessions per user for a simple JSP object.
              It shows in "ADmin Console/mydomain> DefaultWebApp> Web Applications> DefaultWebApp>
              Servlet Runtimes":
              1 /count.jsp
              1 /*.jsp
              In a non-clustered environment this does not happen.
              Is that normal?
              

    I found the problem myself. For some reason WL did not like any special characters in the system password. I am not sure which ones are valid and which are not but I am avoiding them all right now.

  • Basic File Sharing question between user accounts on my iMac

    I don't understand how to be able to share and download to one common folder among User Accounts on my iMac. I am trying to use a Clean Account as a test, and wanted to copy a file I downloaded from the web in one account into this clean account folder, and install the file.
    I went to Sharing and thought I turn File Sharing on. Logged into the Clean account and Apple+I the folder, changing access priviledges to the folder. Then copy the file into the Clean User Account.
    But it doesn't work that way. Can anyone help me understand sharing between accounts?

    File Sharing is for sharing files between two different machines, not between different accounts on the same machine. If you want to share files on one machine, you just need to put them in a folder everyone has access to, like the /Users/shared folder. Also, don't go fooling around with folder permissions... that's a good way to mess things up. If I had a nickel for every time someone messed up their system using the "Apply to enclosed items" option when changing permissions, I'd be a rich man!

Maybe you are looking for

  • How to install windows 7 on macbook properly?

    Hello there; I've macbook 2007. I bought it used and it had windows 7 installed on it. something went wrong with the W7 and had to reinstall a fresh one one. I booted from W7 DVD and reinstalled the windows, everything is ok. network - wireless - gra

  • How can i update my OS 10.6.8 to enable me to update to yosemite

    how can i update my OS 10.6.8 to enable me to update to yosemite, do I need to download snow leopard first?

  • Pc will not reconize iphone

    Ok my problem is my computer running windows 7 it will not attempt to connect to iphone. when plugging in it dose nothing as if nothing is going on. my old iphone (iphone 3g) can still connect to computer with the same cord but not the same results w

  • Installing Windows 7 on a mac mini server

    I just purchased recently a mac mini server. Obviously, the server does not have a disc drive to install media. I would like to install Windows 7 on my mini in a dual boot configuration. I already had bootcamp set up the partitions, but i can't get i

  • Partner Determ. Proc. in Leadoverruled when created from Mkt Campaign

    Hello guru's I have created a Partner Determination Procedure for the partner "employee responsible" in a Lead (=transaction type). But when I create a Lead from a Marketing Campaign this Partner Determination Procedure is overruled and the person wh