# phpman > man > pam_open_session(3)

[PAM_OPEN_SESSION(3)](https://www.chedong.com/phpMan.php/man/PAMOPENSESSION/3/markdown)                       Linux-PAM Manual                       [PAM_OPEN_SESSION(3)](https://www.chedong.com/phpMan.php/man/PAMOPENSESSION/3/markdown)



## NAME
       pam_open_session - start PAM session management

## SYNOPSIS
       **#include** **<security/pam**___**appl.h>**

       **int** **pam**___**open**___**session(pam**___**handle**___**t** *****_pamh_**,** **int** _flags_**);**

## DESCRIPTION
       The **pam**___**open**___**session** function sets up a user session for a previously successful
       authenticated user. The session should later be terminated with a call to
       **pam**___**close**___**[session**(3)](https://www.chedong.com/phpMan.php/man/session/3/markdown).

       It should be noted that the effective uid, [**geteuid**(2)](https://www.chedong.com/phpMan.php/man/geteuid/2/markdown). of the application should be of
       sufficient privilege to perform such tasks as creating or mounting the user's home directory
       for example.

       The flags argument is the binary or of zero or more of the following values:

       PAM_SILENT
           Do not emit any messages.

## RETURN VALUES
       PAM_ABORT
           General failure.

       PAM_BUF_ERR
           Memory buffer error.

       PAM_SESSION_ERR
           Session failure.

       PAM_SUCCESS
           Session was successful created.

## SEE ALSO
       **pam**___**close**___**[session**(3)](https://www.chedong.com/phpMan.php/man/session/3/markdown), **pam**___**[strerror**(3)](https://www.chedong.com/phpMan.php/man/strerror/3/markdown)



Linux-PAM Manual                             06/08/2020                          [PAM_OPEN_SESSION(3)](https://www.chedong.com/phpMan.php/man/PAMOPENSESSION/3/markdown)
