in reply to Pulling out the value of a cookie: Revisited
Three comments:
1. Taint check. If someone sneaks Javascript into a cookie, they've set you up for a "cross-site scripting attack" (i.e., you'll end up emitted their javascript in your page).
2. The fragment
should set you up for a one-trip loop, since the value you get back shouldn't have "=" signs embedded unless they're a legal character in the cookie value. You should be able to get by with $user = $query->cookie('user'); 3. Mixing hand-coded HTML with HTML generated by CGI is confusing, and could complicate maintenance. Either use templates, or go all the way with CGI methods.$content = $query->cookie('user'); @new = split ("=", $content);
|
|---|