New Java PPT Sai Jvipul
New Java PPT Sai Jvipul
• CIA -3 Presentation
• Subject: Advance Java
By
• M r. V i p u l S P a ti l
• Mr. Saikrishna B Dandwate
TY BCA- B
PRN NO -- 220105011333
220105011298
Academic year-2024-25
INTRODUCTION TO SESSION
MANAGEMENT
• Advantages:
• Works even if cookies are disabled.
• Simple implementation.
• Disadvantages:
• Security risks (session ID exposed in URL).
• Inconvenient for bookmarking.
• Limited length of URLs.
WHAT ARE COOKIES?
• Definition: Small pieces of data stored on the client-side (browser) and sent back
to the server with each request.
• Types:
• Session Cookies: Deleted when the browser is closed.
• Persistent Cookies: Stored on the user’s device for a defined period.
HOW COOKIES WORK
• Client-Server Flow:
• Server sends a cookie with a response.
• Browser stores the cookie.
• Browser sends the cookie back with subsequent requests to the same
server.
• Usage: Storing user preferences, tracking sessions, authentication tokens.
PROS AND CONS OF COOKIES
• Advantages:
• Simple, widely supported.
• Can store small pieces of user-specific data.
• Disadvantages:
• Limited size (4KB per cookie).
• Privacy concerns (tracking).
• Can be disabled by the user.
HTTP SESSION IN JAVA
How it works:
• A unique session ID is generated for each user.
• Data is stored on the server side, linked with this session ID.
• The session ID is typically maintained via cookies or URL rewriting.
HTTP SESSION VS COOKIES
Definition:
User authorization is the process of granting or denying access to resources based on a user's privileges.
•Examples:
• Key Takeaways:
• URL rewriting can manage sessions when cookies are disabled, but it has security risks.
• Cookies are useful for lightweight, client-side storage, but have size and privacy limitations.
• Final Thought: Choose the appropriate session management technique based on the application's
needs for security, data size, and browser compatibility.