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

Friends don't have their own cookies in PhpBrowser #3911

Closed
insightfuls opened this issue Jan 13, 2017 · 4 comments
Closed

Friends don't have their own cookies in PhpBrowser #3911

insightfuls opened this issue Jan 13, 2017 · 4 comments

Comments

@insightfuls
Copy link
Contributor

@insightfuls insightfuls commented Jan 13, 2017

What are you trying to achieve?

Two users logged into a web site and one performs an action which affects the other. In very pseudo code, something like this:

$fred=$I->haveFriend();
$I->login("grace");
$fred->does(function(AcceptanceTester $I){
    $I->login("fred");
    $I->doSomething();
});
$I->seeTheConsequences();

What do you get instead?

The problem is that friends don't seem to have independent cookies. When the code gets to $I->seeTheConsequences() the main tester ($I) has hijacked Fred's session because Fred's call to $I->login("fred") has replaced the cookie from $I->login("grace").

Details

  • Codeception version: 2.2.7
  • PHP Version: 5.6
  • Operating System: Mac OS X
  • Installation type: Phar
  • List of installed packages: none via composer; don't believe it is relevant anyway
  • Suite configuration:
class_name: AcceptanceTester
modules:
    enabled:
        - \Module\PhpBrowser:
            url: http://localhost:8989/WebInterface.php
insightfuls added a commit to insightfuls/Codeception that referenced this issue Jan 13, 2017
@insightfuls
Copy link
Contributor Author

@insightfuls insightfuls commented Jan 13, 2017

I've managed to address this with a pull request, #3912.

@insightfuls
Copy link
Contributor Author

@insightfuls insightfuls commented Jan 13, 2017

I've discovered my pull request breaks code coverage analysis. I'm considering how I might be able to fix it.

insightfuls added a commit to insightfuls/Codeception that referenced this issue Jan 14, 2017
@insightfuls
Copy link
Contributor Author

@insightfuls insightfuls commented Jan 14, 2017

I've fixed up my pull request. The problem is now tested and fixed. I considered a number of options and implemented something I thought was pretty clean, but I'm open to suggestions.

@DavertMik
Copy link
Member

@DavertMik DavertMik commented Jan 16, 2017

Thanks for the report and your work!

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.