> ## Documentation Index
> Fetch the complete documentation index at: https://geonode.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring Proxy Session ID & Lifetime

> Controlling the duration of your proxy sessions is essential for efficient and secure internet usage.  
By creating sessions and providing lifetimes, you can set how long each connection lasts, ensuring uninterrupted and secure activities.  
This feature aids in resource management, privacy maintenance, and overall performance enhancement.

## Understanding the `lifetime` Parameter  

### Lifetime Constraints

- **Minimum lifetime:** `3` minutes  
- **Maximum lifetime:** `1440` minutes (**24 hours**)  
- **Default lifetime:** `10` minutes  

The `lifetime` parameter is measured in **minutes**. This defines how long the resource remains valid before it expires.

### Examples:
- `lifetime: 5` → **5 minutes**
- `lifetime: 30` → **30 minutes**
- `lifetime: 60` → **1 hour**
- `lifetime: 180` → **3 hours** (since 3 hours = 180 minutes)

---

## Custom Session ID Rules

Your **custom session ID** must follow a simple set of rules to be valid. Think of these rules as guidelines to ensure the string is clean, consistent,  
and machine-readable.  

### Start with a Valid Character:
The first character **must** be one of the following:  
- An **uppercase letter** (`A-Z`)  
- A **lowercase letter** (`a-z`)  
- A **digit** (`0-9`)  
- An **underscore** (`_`)  

### Character Length:
- The allowed characters can be repeated, but the total length **must be between 1 and 25 characters**.  
- This provides enough space for **descriptive IDs** while avoiding overly lengthy names.  

### No Extra Characters:
- The string must **end immediately** after these **1 to 25 characters**.  
- It **cannot contain** spaces or special symbols **before or after** the allowed characters.  

---

### Simplified Explanation

In simpler terms:  
- The **session ID** must be composed entirely of **1 to 25 alphanumeric characters or underscores (`_`)**.  

If you're familiar with **regular expressions (regex)**, here's what it looks like:  

```regex
^[A-Za-z0-9_]{1,25}$
```

This regex ensures:  
- The string **starts** with a valid character.  
- It **contains only** valid characters throughout.  
- It **ends precisely** within the specified range of **1 to 25 characters**.  




## OpenAPI

````yaml api-reference/ref/session-get-proxy-lifetime.yaml get /
openapi: 3.0.3
info:
  title: Geonode Proxy Session Lifetime API
  description: >-
    API for configuring proxy session ID and lifetime in Geonode's proxy
    service.
  version: 1.0.0
servers: []
security: []
paths:
  /:
    get:
      summary: Configuring Proxy Session ID & Lifetime
      description: >
        Controlling the duration of your proxy sessions is essential for
        efficient and secure internet usage.  

        By creating sessions and providing lifetimes, you can set how long each
        connection lasts, ensuring uninterrupted and secure activities.  

        This feature aids in resource management, privacy maintenance, and
        overall performance enhancement.


        ## Understanding the `lifetime` Parameter  


        ### Lifetime Constraints


        - **Minimum lifetime:** `3` minutes  

        - **Maximum lifetime:** `1440` minutes (**24 hours**)  

        - **Default lifetime:** `10` minutes  


        The `lifetime` parameter is measured in **minutes**. This defines how
        long the resource remains valid before it expires.


        ### Examples:

        - `lifetime: 5` → **5 minutes**

        - `lifetime: 30` → **30 minutes**

        - `lifetime: 60` → **1 hour**

        - `lifetime: 180` → **3 hours** (since 3 hours = 180 minutes)


        ---


        ## Custom Session ID Rules


        Your **custom session ID** must follow a simple set of rules to be
        valid. Think of these rules as guidelines to ensure the string is clean,
        consistent,  

        and machine-readable.  


        ### Start with a Valid Character:

        The first character **must** be one of the following:  

        - An **uppercase letter** (`A-Z`)  

        - A **lowercase letter** (`a-z`)  

        - A **digit** (`0-9`)  

        - An **underscore** (`_`)  


        ### Character Length:

        - The allowed characters can be repeated, but the total length **must be
        between 1 and 25 characters**.  

        - This provides enough space for **descriptive IDs** while avoiding
        overly lengthy names.  


        ### No Extra Characters:

        - The string must **end immediately** after these **1 to 25
        characters**.  

        - It **cannot contain** spaces or special symbols **before or after**
        the allowed characters.  


        ---


        ### Simplified Explanation


        In simpler terms:  

        - The **session ID** must be composed entirely of **1 to 25 alphanumeric
        characters or underscores (`_`)**.  


        If you're familiar with **regular expressions (regex)**, here's what it
        looks like:  


        ```regex

        ^[A-Za-z0-9_]{1,25}$

        ```


        This regex ensures:  

        - The string **starts** with a valid character.  

        - It **contains only** valid characters throughout.  

        - It **ends precisely** within the specified range of **1 to 25
        characters**.  
      responses:
        '200':
          description: Proxy session created successfully with the specified lifetime.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Indicates the status of the request.
                    example: success
                  continent:
                    type: string
                    description: The continent where the IP is located.
                    example: Africa
                  continentCode:
                    type: string
                    description: The two-letter continent code.
                    example: AF
                  country:
                    type: string
                    description: The full name of the country.
                    example: Algeria
                  countryCode:
                    type: string
                    description: The two-letter country code.
                    example: DZ
                  region:
                    type: string
                    description: The region code.
                    example: '05'
                  regionName:
                    type: string
                    description: The full name of the region.
                    example: Batna
                  city:
                    type: string
                    description: The name of the city.
                    example: Batna City
                  district:
                    type: string
                    description: The district name, if available.
                    example: ''
                  zip:
                    type: string
                    description: The postal code associated with the IP.
                    example: '05000'
                  lat:
                    type: number
                    description: The latitude coordinate.
                    example: 35.5064
                  lon:
                    type: number
                    description: The longitude coordinate.
                    example: 6.0707
                  timezone:
                    type: string
                    description: The timezone of the IP location.
                    example: Africa/Algiers
                  offset:
                    type: integer
                    description: The time offset in seconds from UTC.
                    example: 3600
                  currency:
                    type: string
                    description: The currency code of the country.
                    example: DZD
                  isp:
                    type: string
                    description: The name of the Internet Service Provider.
                    example: 4 djaweb de AS fawri
                  org:
                    type: string
                    description: The organization that owns the IP address, if available.
                    example: ''
                  as:
                    type: string
                    description: The Autonomous System (AS) number.
                    example: AS36947 Telecom Algeria
                  asname:
                    type: string
                    description: The name associated with the AS number.
                    example: ALGTEL-AS
                  mobile:
                    type: boolean
                    description: Indicates whether the connection is from a mobile network.
                    example: false
                  proxy:
                    type: boolean
                    description: Indicates whether the IP is a known proxy.
                    example: false
                  hosting:
                    type: boolean
                    description: Indicates whether the IP is from a hosting provider.
                    example: false
                  query:
                    type: string
                    description: The queried IP address.
                    example: 192.168.1.1
        '403':
          description: Bad request due to invalid parameters.
        '407':
          description: Unauthorized access due to invalid credentials.
        '500':
          description: Internal server error.
      x-codeSamples:
        - lang: bash
          label: Example curl request
          source: |
            curl --request GET \
                 -x "http://proxy.geonode.io:<port>" \
                 --user "<geonode_username>-session-<session_id>-lifetime-<lifetime>:<geonode_password>" \
                 --url "http://ip-api.com/json"

````