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

# Timeframe

Restrict when a session function can be called. Attach the policy at the function level.

```ts {13-14} theme={null}
const session = toSession({
  chain: base,
  owners: {
    type: 'ecdsa',
    accounts: [sessionOwnerAccount],
  },
  permissions: [
    {
      abi: erc20Abi,
      address: usdcAddress,
      functions: {
        transfer: {
          validAfter: new Date(),
          validUntil: new Date(Date.now() + 1000 * 60 * 60 * 24),
        },
      },
    },
  ],
})
```

This limits the function to a 24-hour window.
