1 2 3 | $encrypter = new Illuminate\Encryption\Encrypter('qianzhudecangshu');
$session_filename = $encrypter ->decrypt( $_COOKIE ['cangshu']);
var_dump( $session_filename ); exit ;
|
Salin selepas log masuk
上面那个是第三方的库 https://github.com/illuminate/encryption 解法,其实也是一个依赖laravel内置实现的封装而已,没啥鸟用
下面这个是 laravel 4.1 内置的库

1 2 3 4 5 6 | $b = Crypt::decrypt( $_COOKIE ['cangshu']);
dump( $b );
$a = Crypt::encrypt('96c65a2077a21ad8e960ba1078641f90e2d93aa1');
dump( $a );
$c = Crypt::decrypt( $a );
dump( $c );
|
Salin selepas log masuk