Pluf_Middleware_Session Class Reference

List of all members.

Public Member Functions

 process_request (&$request)
 process_response ($request, $response)

Static Public Member Functions

static _encodeData ($data)
static _decodeData ($encoded_data)
static processContext ($signal, &$params)


Detailed Description

Session middleware.

Allow a session object in the request and the automatic login/logout of a user if a standard authentication against the Pluf_User model is performed.


Member Function Documentation

Pluf_Middleware_Session::process_request ( &$  request  ) 

Process the request.

When processing the request, if a session is found with Pluf_User creditentials the corresponding user is loaded into $request->user.

FIXME: We should logout everybody when the session table is emptied.

Parameters:
Pluf_HTTP_Request The request
Returns:
bool false

Pluf_Middleware_Session::process_response ( request,
response 
)

Process the response of a view.

If the session has been modified save it into the database. Add the session cookie to the response.

Parameters:
Pluf_HTTP_Request The request
Pluf_HTTP_Response The response
Returns:
Pluf_HTTP_Response The response

static Pluf_Middleware_Session::_encodeData ( data  )  [static]

Encode the cookie data and create a check with the secret key.

Parameters:
mixed Data to encode
Returns:
string Encoded data ready for the cookie

static Pluf_Middleware_Session::_decodeData ( encoded_data  )  [static]

Decode the data and check that the data have not been tampered.

If the data have been tampered an exception is raised.

Parameters:
string Encoded data
Returns:
mixed Decoded data

static Pluf_Middleware_Session::processContext ( signal,
&$  params 
) [static]


The documentation for this class was generated from the following file:

Generated on Wed Feb 3 15:44:52 2010 for Pluf by  doxygen