patSession examples overview
These examples show the functionality of patSession in detail. This overview lists all examples with a small description, and to navigate the examples, use the navigation on the left.
patSession::Basics (10)
These examples show how to setup patSession for basic useage.
- First steps
Very first steps in patSession.
- Singleton
Using a the singleton-pattern forces a single instance of patSession.
- Factory
The factory-method allows to create multiple instances of patSession
- Parameters for patSession
This example shows how to use parameters for creating different patSession-objects.
- Options explained
A list of standard-options and how to use them
- Destroy sessions
Shows how to terminate a session. Destroying a session also means to flush all session values.
- Restart
Inactive session may restarted - of course, this will not restore the previous session values. Restarting a session means that you start over with an empty session container - but at least, the session will be active again!
- Session counter
The internal session counter show you how many request were made in this session.
- Internal namespace
patSession itself uses the session container to store some internal values. In order to avoid conflicts, the namespace "patSession" is used as a prefix for all values.
- Custom storage driver
The official distribution of patSession only contains general purpose storage driver.
Still you can implement your own driver without getting in conflict with your patSession installation.
patSession::Security (6)
Session and Security is a very important topic. These examples shows how to use patSession for a secure environment
- Expire
Expire idle sessions
- Fix browser
patSession allows to fix a session to a browser. Therefore all session data will be destroyed if the users tries to continue the session wit a different browser
- Fix IP address
This feature avoids to continue any session from a different IP address then it was started.
- Fix referer
Fixiation of the referer forces to stay on the same referer.
- Use token
Ping-Pong disposible token for each request.
- Forking
Forking a session clones the current session values and continues with a new session
patSession::SPL (3)
SPL features of patSession
- ArrayAccess
Use array syntax $sess[] instead of get(), set(), has() and clear()
- Iterator
Use foreach to iterate through session variables
- Property-a-like
Use property syntax to shortcut function calls
patSession::Testing (4)
Some testing php-files used during development