Download the PHP package refkinscallv/session without Composer

On this page you can find all versions of the php package refkinscallv/session. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package session

Here's the README.md for the Session library, including installation instructions, sample .env file, and usage details:


Session Library with Timeout and Flash Data Support

The Session class provides advanced session management with features like automatic session timeout handling, flash data storage, and more. This library allows you to manage session values easily and securely.


Features


Installation

  1. Install the Package via Composer

    To install the refkinscallv/session package, run the following command:

    This command will download and install the library along with its dependencies.

  2. Include the Composer Autoloader

    Make sure to include the Composer autoloader at the top of your PHP scripts to automatically load the classes:

  3. Environment Configuration

    Make sure that your environment variables are properly configured for session management. You can do this by creating a .env file in the root directory of your project (if not already present) with the following contents:

    Sample .env File:

    This file defines:

    • SESSION_NAME: The name of the session.
    • SESSION_TIMEOUT: The session timeout duration in hours (default is 1 hour).
    • SESSION_PATH: The path on the server where the session is available.
    • SESSION_SECURE: Whether the session should be marked as secure (use HTTPS only). Set to false by default.
  4. Using the Library

    After installing the package and configuring your environment, you can now begin using the Session class in your project.


Usage

Basic Setup


Configuration

Constructor Parameters

Environment Variables

Variable Description Default Value
SESSION_NAME The name of the session. web_session
SESSION_TIMEOUT The session timeout in hours. 1 (1 hour)
SESSION_PATH The path on the server where the session is available. /
SESSION_SECURE Whether the session should be secure (HTTPS only). false

Methods

start()

Starts the session if it hasn’t already been started.

set(string|array $key, mixed $value = null)

Sets a session value or multiple values if an associative array is provided.

get(string $key, mixed $default = null)

Retrieves a session value by key. If the key doesn’t exist, returns the provided default value.

some(array $keys, mixed $default = null)

Retrieves multiple session values by their keys. Returns an associative array with key-value pairs.

has(string $key)

Checks if a session key exists.

remove(string $key)

Removes a session value by key.

setFlash(string $key, mixed $value)

Sets a flash session value. Flash data will persist for one session request.

getFlash(string $key, mixed $default = null)

Retrieves and removes a flash session value.

clear()

Clears all session values.

destroy()

Destroys the session.


Example with Flash Data

Flash data allows you to store session data that only persists for a single request. This is useful for storing messages that need to be displayed once, such as success or error messages.


Notes


License

This library is released under the MIT License.


All versions of session with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package refkinscallv/session contains the following files

Loading the files please wait ....