2

Possible Duplicate:
What is the best way to prevent session hijacking?
Is encrypting session id (or other authenticate value) in cookie useful at all?

My session handler stores the session ID in a cookie and returns the value of the cookie to use as a reference to the database.

My question is short and simple. Should I encrypt the session ID in the cookie or would this be pointless?

Thanks! :)

Community
  • 1
  • 1

1 Answers1

5

This is totally pointless. Even if you encrypt your session id, an encrypted version will be sent to your server via cookie. If someone wants to hijack it he will steal that encrypted session id and send it to your server. Your server will happily decrypt it.

Shiplu Mokaddim
  • 54,465
  • 14
  • 131
  • 183