简体   繁体   中英

Get Laravel session data (Memcached) outside of Laravel

Is there a way to get session data stored by Laravel outside of Laravel when using Memcached as session driver? (Only one part of the project is written in Laravel)

For example I put something in the session with Laravel:

Session::put('name', $user->name);

How can I retrieve this from another script (not in Laravel)?

I know I need a key. I've searched in Laravel files how the keys for sessions in Memcached are being generated, however I could not find anything.

Laravel saves a key in a Cookie, which is called "laravel-session" by default. Decrypt this key and add a prefix ("laravel:" by default). This is the key in which laravel stores serialized session data about a user in Memcached.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM