Overview

Namespaces

  • api
  • config
  • database
  • PHP
  • Slim
    • Exception
    • Http
    • Middleware

Classes

  • ContentTypes
  • Flash
  • MethodOverride
  • PrettyExceptions
  • SessionCookie
  • Overview
  • Namespace
  • Class
  • Tree

Class SessionCookie

Session Cookie

This class provides an HTTP cookie storage mechanism for session data. This class avoids using a PHP session and instead serializes/unserializes the $_SESSION global variable to/from an HTTP cookie.

If a secret key is provided with this middleware, the HTTP cookie will be checked for integrity to ensure the client-side cookie is not changed.

You should NEVER store sensitive data in a client-side cookie in any format, encrypted or not. If you need to store sensitive user information in a session, you should rely on PHP's native session implementation, or use other middleware to store session data in a database or alternative server-side cache.

Because this class stores serialized session data in an HTTP cookie, you are inherently limtied to 4 Kb. If you attempt to store more than this amount, serialization will fail.

Slim\Middleware
Extended by Slim\Middleware\SessionCookie
Namespace: Slim\Middleware
Package: Slim
Author: Josh Lockhart
Since: 1.6.0
Located at thirdparty/Slim/Middleware/SessionCookie.php
Methods summary
public
# __construct( array $settings = array() )

Constructor

Constructor

Parameters

$settings
array
$settings
public
# call( )

Call

Call

protected
# loadSession( )

Load session

Load session

protected
# saveSession( )

Save session

Save session

public
# open( mixed $savePath, mixed $sessionName )
public
# close( )
public
# read( mixed $id )
public
# write( mixed $id, mixed $data )
public
# destroy( mixed $id )
public
# gc( mixed $maxlifetime )
Methods inherited from Slim\Middleware
getApplication(), getNextMiddleware(), setApplication(), setNextMiddleware()
Properties summary
protected array $settings
#
Properties inherited from Slim\Middleware
$app, $next
GeoApi API documentation generated by ApiGen 2.8.0