I am getting this warning when storage object of my application is set to session.
Unknown: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and ‘-,’ in Unknown on line 0
so I decided to Md5 session id and warning is gone now. But this code is common for all storage options like memcache and phparray. so my question is, is it ok to Md5 memcache keys or session ids? will it create some other problem ? or is there any better solution ?
It is not ok to use md5 for that because an infinite number of strings can result in the same hash. So you don’t want to do that!
Is there any better solution?
Yes. Instead of trying to hack around your problem, address it! Your session id contains illegal chars or is too long! Create valid session ids!