java - Client side sessions -


I want customers of many related web applications to have their own authentication status. This improves scalability, since no session replication is required between cluster nodes. And it makes it easy to integrate various server technologies like Java servers and PHP.

My plan is as follows:

  1. Set up a signed and encrypted cookie with the user name and session end time after client authentication.
  2. The client sends a request, the cookie cookie values ​​the values ​​and validates or denies access based on the cookie values.
  3. The expiry of the session will be updated through resetting cookies.

All servers that want to use the session are only to know the cookie mechanism and decryption keys. Also see:

Is this approach okay? Would it be possible to integrate it into a servlet container / application server, so that it is transparent for applications? A servlet should be able to use HttpServletRequest #getRemoteUser () for example. Is this possible? Or do I need something like spring security than the container level? Are there any existing libraries for client side management sessions?

It is not a good idea to end the session and point to the client fully pointing to the username The only dangerous IMO is not encrypted, or even if the concept is technically safe in itself (I can not answer in depth, I am not an encryption expert), by obtaining your encryption key, your server Easy to break-in without compromising Can be made.

Anyone holding a key can generate session cookies at that time, for any user at any time , for a period of time The classical session is designed to prevent the concept

For this problem, there are better and scalable solutions. For example, why not set a central session verification example that all affiliate servers and services are selected Could? Look around the web, I'm 100% sure that there are solutions designed to meet your needs.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -