0

シナリオ:自分のサイトでセッションを開始すると、ユーザーに一度表示されるランドトークンを生成します。後で使用するために「保管」するとします。次に、タイムスタンプを使用してmd5(トークン)をSQLに挿入します。ユーザーがログインなどの他のページにアクセスする場合、検証プロセスの一環として、URLを介してトークンを渡す必要があります。トークンが存在するかどうかを確認し、おそらくこのトークンのユーザーIDを更新します。

それで。誰かがユーザーのPHPSESSIDCookieを盗んだとしても、トークンを知らないとこれらのページにアクセスできないため、ハッカーにとっては何の役にも立ちませんか?

4

1 に答える 1

1

You are right that they won't be able to access the pages without the token, but as an added point, sometimes I'd like to use IP tracking or browser tracking used concurrently as well.

The rationale being that even if someone gets a PHPSESSID cookie and the token, he would have to be coming from the same IP source as well as use the same browser. Then again these are just means of security by obscurity.

I recommend if you are really concerned about security, you can try looking at using a HTTPS connection. Hope it helped. Cheers!

于 2011-05-01T05:17:56.477 に答える