### Method

# Soup Cookie set_max_age

#### Declaration [src]

    void
    soup_cookie_set_max_age (
      SoupCookie* cookie,
      int max_age
    )

#### Description [src]

Sets `cookie`‘s max age to `max_age`.

If `max_age` is -1, the cookie is a session cookie, and will expire at the end of the client’s session. Otherwise, it is the number of seconds until the cookie expires. You can use the constants `SOUP_COOKIE_MAX_AGE_ONE_HOUR`, `SOUP_COOKIE_MAX_AGE_ONE_DAY`, `SOUP_COOKIE_MAX_AGE_ONE_WEEK` and `SOUP_COOKIE_MAX_AGE_ONE_YEAR` (or multiples thereof) to calculate this value. (A value of 0 indicates that the cookie should be considered already-expired.)

This sets the same property as `soup_cookie_set_expires()`.

#### Parameters

`max_age` | `int`
| The new max age.