What is the difference between session tracking using cookies and using URL rewriting in J2EE?

1 Answers
Answered by suresh

Difference between session tracking using cookies and using URL rewriting in J2EE | J2EE Interview Question

Difference between session tracking using cookies and using URL rewriting in J2EE

Session tracking is a crucial aspect of web development in J2EE to maintain user state across multiple requests. Here's the difference between session tracking techniques using cookies and URL rewriting:

Using Cookies:

1. Cookies are small pieces of data stored on the client-side browser.

2. Cookies are automatically sent by the browser to the server with each request, allowing the server to identify the user.

3. Cookies can be set with an expiration time, making them persistent across sessions.

Using URL Rewriting:

1. URL rewriting involves appending session IDs or tokens to URLs within the application.

2. When a user accesses a page, the session ID in the URL is used by the server to identify the user's session.

3. URL rewriting does not rely on the browser to store session information.

Ultimately, the choice between using cookies and URL rewriting for session tracking in J2EE depends on factors such as security requirements, user privacy concerns, and ease of implementation.

Answer for Question: What is the difference between session tracking using cookies and using URL rewriting in J2EE?