Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/17Franco/CulturarteWeb/llms.txt

Use this file to discover all available pages before exploring further.

The logout servlet provides a single, safe way for users to end their CulturarteWeb session. It calls session.invalidate() on the existing HttpSession (if one is present), then redirects the browser to the application root. Because the session is destroyed, any subsequent request to a protected resource will treat the user as unauthenticated.

GET /logout

Terminates the current session and redirects the user.
StepDetail
1. Retrieve sessionrequest.getSession(false) — does not create a new session if none exists.
2. InvalidateIf a session is found, session.invalidate() is called, removing all stored attributes (including logueado and tipoUser).
3. Redirect302 Found{contextPath}/ (the BuscadorPropuestas welcome servlet, which will in turn redirect unauthenticated users to the login page).
No request parameters are required.

Parameters

None. The endpoint does not read any query string or body parameters.

Example

Place this in any JSP or HTML template to give authenticated users a logout button:
<a href="${pageContext.request.contextPath}/logout">Cerrar Sesión</a>

curl

# Log out by hitting the endpoint with the active session cookie
curl -i -b cookies.txt \
  http://localhost:8080/CulturarteWeb/logout
The server responds with a 302 redirect to /CulturarteWeb/. Because the session cookie is now invalid, any further request made with that same cookies.txt jar will be treated as unauthenticated.
Sessions also expire automatically after 30 minutes of inactivity, as configured in WEB-INF/web.xml. You do not need to call /logout explicitly for idle sessions — the Jakarta EE container will invalidate them on its own. However, calling /logout immediately is recommended when the user actively ends their session, to free server-side memory and prevent session-hijacking via an abandoned browser tab.

Build docs developers (and LLMs) love