Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6539275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:50:21+00:00 2026-05-25T10:50:21+00:00

I store user.displayName in the session, when users authenticate: session.put(udn, user.displayName); and the template

  • 0

I store user.displayName in the session, when users authenticate:

session.put("udn", user.displayName);

and the template renders it using:

${session.udn}

but strange things occur:

  1. login as “Sam”, display “Sam”;
  2. logout;
  3. login as “Jim”, display “Sam”, too!
  4. restart play;
  5. login as “Jim”, display “Jim”;
  6. logout;
  7. login as “Sam”, display “Jim”, too!

That is, it always display the first logged in user’s displayName.

debug just after the session.put:

session.put("udn", user.displayName);

Logger.debug("udn:\t" + session.get("udn"));

it prints correctly:

  • login as Sam, prints “udn:Sam”;
  • login as Jim, prints “udn:Jim”

also, I checked the cookie:
PLAY_SESSION contains %00udn%3A + correct value + %00:

  • login as Sam, PLAY_SESSION contains %00udn%3ASam%00
  • login as Jim, PLAY_SESSION contains %00udn%3AJim%00

How do I display the correct value? (my play app depends on play 1.2.3 & Secure module)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:50:22+00:00Added an answer on May 25, 2026 at 10:50 am

    You should be using ${session.get("udn")} in your template. The implicit session variable is just an instance of play.mvc.Scope.Session; there’s no magic in place that would allow syntax like ${session.udn}. I’m not sure why that prints anything at all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how to Store User's Last Page Visited using session in php5? when user come
I store user editable articles in a database. Users can insert some simple widgets
I need to store user entered changes to a particular table, but not show
How can we store user information in session in silverlight, mean how to handle
Is it safe to store user inputted passwords in session variables which are used
I am using mongodb to store user's events, there's a document for every user,
Originally I was using isolated storage to store user settings in a Silverlight app
I store user data in a MSSQL table called Users. What I want to
What is the best database model to store user visits and count unique users
I'm using a web form to store user input into a MySQL DB, using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.