Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with unserialized cookies #87

Open
wants to merge 1 commit into
base: release/0.10
Choose a base branch
from

Conversation

ryzr
Copy link
Contributor

@ryzr ryzr commented Nov 19, 2018

I haven't got time to test this properly - but see no reason why it should work. Follows the same methods as the EncryptCookies middleware:

https://github.com/laravel/framework/blob/5.7/src/Illuminate/Cookie/Middleware/EncryptCookies.php#L103

@ryzr ryzr added the bug label Nov 19, 2018
@ryzr ryzr requested a review from lvcasjm November 19, 2018 00:43
@lvcasjm lvcasjm removed their assignment Nov 22, 2022
@ryzr ryzr requested a review from lvcasjm December 2, 2022 01:33
@ryzr ryzr marked this pull request as draft December 2, 2022 01:33
@ryzr ryzr marked this pull request as ready for review December 2, 2022 01:33
@ryzr
Copy link
Contributor Author

ryzr commented Dec 2, 2022

@Noodlewitt pls help us review this important change

@Noodlewitt
Copy link
Member

sure - can you do a mailout to all our current users to make sure they are ok with this? 😂

Copy link
Member

@Noodlewitt Noodlewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💩

@@ -69,9 +70,10 @@ protected function startSession(Request $request)
public function getSession(Request $request)
{
return tap($this->sessionManager->driver(), function ($session) use ($request) {
if ($encryptedSessionId = $request->cookies->get($session->getName())) {
$sessionId = $this->encrypter->decrypt($encryptedSessionId);
$isSerialized = EncryptCookies::serialized($session->getName());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryzr can you verify that tabs or spaces would be better here please?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen Shot 2022-12-12 at 10 10 03 am

I recommend something like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably also add a test

<?php

namespace Tests;

use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\TestCase;

class FizzBuzzTest extends TestCase
{
    use CreatesApplication, DatabaseMigrations;

    public function testItPerformsFizzBuzzCorrectly()
    {
        $this->runDatabaseMigrations();
        $this->seed();

        $this->assertEquals("12Fizz4BuzzFizz78FizzBuzz11Fizz1314FizzBuzz1617Fizz19BuzzFizz2223FizzBuzz26Fizz2829FizzBuzz3132Fizz34BuzzFizz3738FizzBuzz41Fizz4344FizzBuzz4647Fizz49BuzzFizz5253FizzBuzz56Fizz5859FizzBuzz6162Fizz64BuzzFizz6768FizzBuzz71Fizz7374FizzBuzz7677Fizz79BuzzFizz8283FizzBuzz86Fizz8889FizzBuzz9192Fizz94BuzzFizz9798FizzBuzz", logFizzBuzz(), 'Bad Fizz Buzz');
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants