Results 1 to 4 of 4

Thread: Save some additional info in session scope after login

  1. #1
    Join Date
    Jul 2006
    Posts
    109

    Default Save some additional info in session scope after login

    Hi, after successufull login I wan't to store some additional info about user which will be shown on every jsp page in application (for example: where logged user is working, etc.).

    I solved this way:
    Default page of app is index.htm with redirection to loginController which is just concrete implementation of Controller interface. in handleRequest method I just store some attributes in session.

    Problem is, if session expire or if user attempt to get some other page instead of default it will never get to loginController, so required attributes would not be in session scope.

    Any idea how to solve this?

    Thanks in advance. Regards.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    The user object from acegi is (depending on your configuration) is also stored on the session. Why not just extends the ACEGI supplied User and add the properties you need there. This way all the properties for the user object are available for every page right after the login from acegi.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,425

    Default

    It would absolutely agree with Marten. The User object is the most sensible place to extend.
    http://www.acegisecurity.org/multipr...ails/User.html

  4. #4
    Join Date
    Jul 2006
    Posts
    109

    Default

    Why not just extends the ACEGI supplied User and add the properties you need there.
    I already did it but I wasn't thinking about to use it in that way because Acegi is new for me and some bad habit forces me to do it on a "stupid" way.

    Thanks for your help mdeinum and karldmoore.

    Regards.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •