Skip to content

Commit 05af6c2

Browse files
Update README.md
1 parent cf9fcd8 commit 05af6c2

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ For Java Security
44

55
* [Custom Error Page](#Custom-Error)
66
* [Restrict File to Access](#forbidden)
7+
* [Broken Session Managment](#Session-fix)
78

89

910

@@ -31,3 +32,24 @@ Create web.xml and insert below code
3132
## forbid.jsp is location of custom error page
3233
3334
```
35+
## Session-fix
36+
37+
using session
38+
39+
```
40+
request.getSession(false).invalidate();
41+
HttpSession session = request.getSession(true);
42+
43+
session.setAttribute("uname", uname);
44+
session.setAttribute("pass", pass);
45+
46+
response.sendRedirect("welcome.jsp");
47+
```
48+
49+
on logout
50+
```
51+
HttpSession session = request.getSession();
52+
session.removeAttribute("uname");
53+
session.invalidate();
54+
response.sendRedirect("login.jsp");
55+
```

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy