Download the PHP package ycs77/laravel-recover-session without Composer

On this page you can find all versions of the php package ycs77/laravel-recover-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 laravel-recover-session

Laravel Recover Session

Latest Version on Packagist GitHub Tests Action Status Style CI Build Status Total Downloads

Recover Laravel session when sending a form post request back from a third-party API like NewebPay.

Currently, Laravel's default Cookie SameSite value is set to Lax. This setting prevents cookies from being sent when using form post requests to transmit data to websites on other domains. Consequently, after completing a payment and being redirected back to the original website, users may appear to be automatically logged out due to the inability to retrieve the original login cookie. This package addresses and resolves this issue.

Installation

Via Composer:

Publish config:

Usage

Now you need to call RecoverSession::preserve() to save the current session ID into the cache and include the key in your callback URL. This allows the current session to be resumed after the API returns with the key:

This package will automatically retrieve the encrypted session ID from the callback URL and restore the original session state upon returning to the site.

Reference details for the SameSite: https://developers.google.com/search/blog/2020/01/get-ready-for-new-samesitenone-secure

Manually Register Middleware

If you are not using the global recover session, you can set the config recover-session.global to false, and adjust the order of the middleware so that RecoverSession is placed below StartSession. by default, Laravel's Kernel does not include the $middlewarePriority property, so you need to add it manually.

If you are using Laravel 9 or 10, you should add the $middlewarePriority property in your application's app/Http/Kernel.php file:

If you are using Laravel 11+, you can add the RecoverSession middleware to the $middlewarePriority property in the app/Http/Kernel.php file:

If you are using Laravel 11.31+, it provides a concise method to append middleware to the priority list:

Final, you can add the RecoverSession middleware to the callback route for the API:

Sponsor

If you think this package has helped you, please consider Becoming a sponsor to support my work~ and your avatar will be visible on my major projects.

Become a Patron

Credits

License

MIT LICENSE


All versions of laravel-recover-session with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
illuminate/cache Version >=9.0
illuminate/config Version >=9.0
illuminate/contracts Version >=9.0
illuminate/encryption Version >=9.0
illuminate/http Version >=9.0
illuminate/session Version >=9.0
illuminate/support Version >=9.0
symfony/http-foundation Version >=6.0
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 ycs77/laravel-recover-session contains the following files

Loading the files please wait ....