in reply to Regular Expressions in a cookie
Keep in mind that although the average user can't see or interfere with cookies, they are just as unsafe as any other data you're getting from a user. A malicious user could manually design a cookie to attack your system and cause it to behave in ways you did not intend.
Be very careful when using cookies for anything else than encrypted or easily verifiable information. They are no safer than information passed as form parameters or part of the URL. The only difference is they can be stored between sessions.
Instead of passing the name and membership details, consider sending just an identifying number, a timestamp and a hash of the number + the timestamp + a secret string only known by your scripts. That way, you can check the identifier against the hash to determine if it has been tampered with. If the hash doesn't check out, deny the request. It still won't be 100% safe but atleast it won't be trivial.
Time flies when you don't know what you're doing
|
|---|