> For the complete documentation index, see [llms.txt](https://developer.magtek.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.magtek.com/hardware/card-readers/mms-dyna-devices/dynaflex-ii-ped/documentation/developers-manuals/dynaflex-ii-ped-programmers-manual/commands/device-control/extend-session.md).

# Extend Session

## Command 0x1F03 - Extend Session (Session Management Only) <a href="#toc203725814" id="toc203725814"></a>

The host can use this command to extend a session for open protocol interfaces, such as the WLAN interface, which require session management to meet PCI requirements.

The sequence of events is as follows:

{% stepper %}
{% step %}

### Session start

The host establishes a session with the device on a given interface. For the WLAN interface, a session starts when the host establishes a TLS websocket connection with the device.
{% endstep %}

{% step %}

### Device session timer

The device starts a countdown timer for a 30 minute session timeout period.
{% endstep %}

{% step %}

### Session expiring notifications

Five minutes before the session timeout period expires, the device starts repeatedly (every minute) sending **Notification 0x1001 - Device Information Update** to report **Session Management / Session Expiring Soon**.
{% endstep %}

{% step %}

### Host may extend the session

The host may extend the session multiple times, until the device automatically resets to meet PCI’s 24 hour self-test requirement, by sending any command request using the same interface before the timeout occurs. Upon receiving the command, the device resets the session countdown timer to 30 minutes. This helps prevent the session from expiring while the host is actively using the device, including when the device is performing a transaction.

If the host wants to extend the session but does not need to send another command, it may follow these steps at any time during the session:

{% stepper %}
{% step %}

### Construct command request

The host constructs the command request in the format below.
{% endstep %}

{% step %}

### Send command request

The host sends the command request to the device.
{% endstep %}

{% step %}

### Device responds

The device sends a response in the format below to the host.
{% endstep %}

{% step %}

### Timer reset

The device resets the session countdown timer to 30 minutes.
{% endstep %}
{% endstepper %}
{% endstep %}

{% step %}

### Session expiration

When the session expires, the device closes the websocket connection.
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.magtek.com/hardware/card-readers/mms-dyna-devices/dynaflex-ii-ped/documentation/developers-manuals/dynaflex-ii-ped-programmers-manual/commands/device-control/extend-session.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
