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

  • SEARCH
  • Home
  • 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 6611621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:59:36+00:00 2026-05-25T19:59:36+00:00

I have an existing Java EE web application running on GlassFish 3.1. Sign in

  • 0

I have an existing Java EE web application running on GlassFish 3.1. Sign in works fine through the jdbcRealm configured in GlassFish 3.1.

Someone on another team is developing a separate web application in PHP, the boss doesn’t want the user of the apps to have to sign in twice. That is, when they are signed in to the Java web app and they click a link that takes them to the PHP app, they should already be signed in to that app as well. (And vice-versa.)

Not sure how to implement this. I was thinking that I could generate a long random key (a token) that gets generated on log in of either app, and passed around in every web request for either app to identify a logged in user, but that doesn’t seem safe.

I need pointers in the right direction.

  • 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-25T19:59:37+00:00Added an answer on May 25, 2026 at 7:59 pm

    You said

    I was thinking that I could generate a long random key (a token) that
    gets generated on log in of either app, and passed around in every web
    request for either app to identify a logged in user, but that doesn’t
    seem safe.

    But that’s essentially how sessions work.

    Your best bet is to generate a unique login identifier (as you said) store it in a database or memory cache accessible by both apps and find a way to save it such that both web apps can retrieve it.

    If both apps are on same root domain, you can use a cookie with path set to / so both apps can access it.

    If both apps are going to be on different root domain then it will be a little more tricky.

    As for security regarding the identifier token being passed around, you could regenerate the identifier on each request, which guards against cookie jacking.

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

Sidebar

Related Questions

Let's say I have a running Java-based web application with 0 or more valid
I have existing Java application that is using Acegi for authentication/authorization. Our new web
Let's say I have an existing application written in Java which I wish to
I have an existing application (say 'A') and I want to call a java
I have a Java EE application that has REST web services attached to it.
All, I am having some trouble running a java web start application that has
I have a web application that use Sring IoC framework. I use the Java
I'm refactoring an existing (Ajax) Java Web application, which currently holds lots of its
I have developed an WebApplication with Java-Servlets. It is running in a GlassFish-Server (on
I have existing Java EE web applications. And I also have a new Grails

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.