Framework

- About
- Guides
- Community
- API
- Code
- Download

# Kanso API Documentation

Index | View on single page

## session

Functions related to the management of user sessions and account information.

### fakeRequest(userCtx, callback)

Creates a fake request to /_session to pass to sessionChange, useful when using functions such as templates.render

#### Parameters

userCtx | Object |
callback | Function |

### sessionChange(userCtx, callback)

Calls sessionChange if exported from the currently loaded app.

#### Parameters

userCtx | Object |
callback | Function |

### logout(callback)

Logs out the current user.

#### Parameters

callback | Function |

### login(username, password, callback)

Attempt to login using the username and password provided.

#### Parameters

username | String |
password | String |
callback | Function |

### info(callback)

Returns the current user's session information.

#### Parameters

callback | Function |

### userDb(callback)

Returns the authentication database for the current user's session.

#### Parameters

callback | Function |

### signup(username, password, callback)

Creates a new user document with given username and password.

#### Parameters

username | String |
password | String |
callback | Function |