Tips on signed cookies instead of sessions

前端 未结 3 1054
我在风中等你
我在风中等你 2020-12-12 17:36

I\'m considering ditching PHP\'s $_SESSION (i.e. the server-side session handling, to add some language-agnostic flavor) and using signed cookies instead, since

3条回答
  •  既然无缘
    2020-12-12 18:19

    I made CookieStorage exactly for this purpose. All stored values are securely signed with your private key via RIPEMD160 hashing (and salted with time), and optionally encrypted with RIJNDAEL256.

    Each value is stored with the timestamp, which is retrievable.

    Signed example.
    Encrypted example.

    If you prefer, you can use the hash/encrypt/decrypt functions of your choice.

提交回复
热议问题