v5:session:reference:adodb_session_regenerate_id
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
v5:session:reference:adodb_session_regenerate_id [2016/05/22 01:13] – [Usage] mnewnham | v5:session:reference:adodb_session_regenerate_id [2018/07/01 22:05] (current) – typo in class name peterdd | ||
---|---|---|---|
Line 10: | Line 10: | ||
===== Description ======= | ===== Description ======= | ||
Since PHP V4.21, this function has simply been a wrapper for the PHP function [[http:// | Since PHP V4.21, this function has simply been a wrapper for the PHP function [[http:// | ||
- | |||
- | =====Usage===== | ||
- | <code php> | ||
- | include_once ' | + | ===== Session Cookie Regeneration ===== |
- | include_once " | + | |
- | ADODB_session:: | + | The method '' |
- | $_SESSION[' | + | =====Usage===== |
- | $_SESSION[' | + | <code php> |
- | $_SESSION[' | + | include |
+ | ADODB_Session:: | ||
+ | session_start(); | ||
+ | /* | ||
+ | * Approximately every 10 page loads, reset cookie for safety. | ||
+ | * This is extremely simplistic example, better | ||
+ | * to regenerate only when the user logs in or changes | ||
+ | * user privilege levels. | ||
+ | */ | ||
+ | if ((rand()%10) | ||
+ | adodb_session_regenerate_id(); | ||
+ | </ | ||
- | |||
- | |||
- | adodb_session_regenerate_id(); | ||
- | |||
- | </ |
v5/session/reference/adodb_session_regenerate_id.1463872435.txt.gz · Last modified: 2017/04/21 11:38 (external edit)