Best practices for SessionId/Authentication Token generation

UUID generation is random, but random with bad entropy means that you will end up with easy to guess UUIDs. If you use a good random number generator, you can generate UUIDs that can be used for sessions. The catch to this, however, is that UUIDs don’t have built-in re-play prevention, tampering, fixation, etc., you … Read more

What is the length of a PHP session id string?

Depends on session.hash_function and session.hash_bits_per_character. Check out the session_id page for more info. The higher you set session.hash_bits_per_character the shorter your session_id will become by using more bits per character. The possible values are 4, 5, or 6. When using sha-1 for hashing (by setting ini_set(‘session.hash_function’, 1) the following session string lengths are produced by … Read more

How to differ sessions in browser-tabs?

You can use HTML5 SessionStorage (window.sessionStorage). You will generate a random id and save in session Storage per Browser Tab. Then each browser tab has his own Id. Data stored using sessionStorage do not persist across browser tabs, even if two tabs both contain webpages from the same domain origin. In other words, data inside … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)