W
W
web_dev2014-09-17 17:46:46
Java
web_dev, 2014-09-17 17:46:46

Java: new browser -> new session?

Hello,

I can’t even “google” something ...
How can I make a new session be generated for each individual browser?

For example, I went through firefox to a specific address, got a SESSION_ID.
Then I want to go to the same address from chrome and get a new SESSION_ID, unfortunately I get the same one.

Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Max, 2014-09-17
@AloneCoder

Most likely, the settings of your application server are to blame for everything.
What do you have?

W
web_dev, 2014-09-17
@web_dev

Most likely the eyes that want to sleep are to blame.

@GET
  @Path("/auth")
  @Produces(MediaType.APPLICATION_JSON)
  @Consumes(MediaType.APPLICATION_JSON)
  public Response authorisation()
  {

    if (kasSessionId == null) {
      log.info("KAS_SESSION_ID_FOR_Authenticate: {}", kasSessionId); //null
      getAuthenticate();
      log.info("KAS_SESSION_ID_AFTER_Authenticate: {}", kasSessionId); //session_id
      request.getSession().setAttribute("KAS_SESSION_ID", kasSessionId);
    }
    else {
      log.info("KAS_SESSION_ID: {}", kasSessionId);
    }

    return Response.ok().build();
  }

I write a variable to an attribute, and then I check it constantly. Thank you - the issue has already been resolved.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question