Not a good idea. Storing vital data, such as session expiration and user name entirely on the client side, is too dangerous IMO, encrypted or not. Even if the concept is technically safe in itself (I canโt completely answer this question, Iโm not an encryption expert), hacking could be facilitated without harming your server by simply purchasing an encryption key.
Someone who takes possession of the key can generate session cookies at their discretion, impersonating any user for some period of time that the classic concept of the session is designed to prevent.
There are better and more scalable solutions for this problem. Why not create, for example, a central session verification instance that all related servers and services could query? Take a look around the Internet, I am 100% sure that there are ready-made solutions that meet your needs.
Pekka ์ Jan 25 '10 at 10:29 2010-01-25 10:29
source share