Skip to content

Commit 06857be

Browse files
Merge pull request #227 from OWASP/Shruti-s-kulkarni-patch-2
Update Session Management
2 parents f561b5b + d393214 commit 06857be

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,40 @@
1+
title layout tags contributors document order permalink
2+
File Management
3+
col-document
4+
OWASP Developer Guide
5+
Shruti Kulkarni
6+
OWASP Developer Guide
7+
747
8+
/draft/appendices/implementation_dos_donts/Session Management/
9+
{% include breadcrumb.html %}
10+
11+
Session Management
12+
Here is a collection of Do's and Don'ts when it comes to session management, gathered from practical experiences.
13+
14+
Creation of session
15+
Session identifier creation must always be done on a trusted system (e.g., The server)
16+
17+
Creation of session
18+
If a session was established before login, close that session and establish a new session after a successful login
19+
20+
Creation of session
21+
Generate a new session identifier on any re-authentication
22+
23+
Random number generation
24+
Session management controls should use well vetted algorithms that ensure sufficiently random session identifiers. Rely on CSPRNG rather than PRNG for random number generation
25+
26+
Domain and path
27+
Set the domain and path for cookies containing authenticated session identifiers to an appropriately restricted value for the site
28+
29+
Logout
30+
Logout functionality should fully terminate the associated session or connection
31+
32+
Session timeout
33+
Establish a session inactivity timeout that is as short as possible, based on balancing risk and business functional requirements. In most cases it should be no more than several hours
34+
35+
Session ID
36+
Do not expose session identifiers in URLs, error messages or logs. Session identifiers should only be located in the HTTP cookie header. For example, do not pass session identifiers as GET parameters
37+
38+
Session ID
39+
Supplement standard session management for sensitive server-side operations, like account management, by utilising per-session strong random tokens or parameters. This method can be used to prevent Cross Site Request Forgery attacks
140

0 commit comments

Comments
 (0)