0

ゾンビ.jsを使用してPHPアプリに認証しようとしています(2つのsymfony2アプリと同じ結果を試しました)。しかし、ブラウザー セッションはコールバックで同じではありません。これが認証が失敗する理由だと思います。

これが私のnode.jsコードです

var Browser = require("zombie");
var assert = require("assert");

// Load the page from localhost
var browser = new Browser();
browser.site = "http://localhost:8000/";
browser.loadCSS = false;
browser.debug = true;

browser.visit("app.php")
    .then(function(){
        console.log(browser.cookies.dump());

        browser.visit("app.php")
            .then(function() {
                console.log(browser.cookies.dump());
            });
    });

browser.visit("app.php")
    .then(function(){
        console.log(browser.cookies.dump());
    });

そして、コールバックで別の phpssid を使用した結果

$ node test.js    Zombie: Opened window http://localhost:8000/app.php 
Zombie: Closed window http://localhost:8000/app.php 
Zombie: Opened window http://localhost:8000/app.php 
Zombie: GET http://localhost:8000/app.php => 200
Zombie: GET http://localhost:8000/app.php => 200
Zombie: Loaded document http://localhost:8000/app.php
Zombie: GET http://localhost:8000/app.php/js/0b50c2c.js => 200
PHPSESSID=3qsqvtaseidgb5599803evt604; Domain=localhost; Path=/
[ true ]
Zombie: Closed window http://localhost:8000/app.php 
Zombie: Opened window http://localhost:8000/app.php 
PHPSESSID=3qsqvtaseidgb5599803evt604; Domain=localhost; Path=/
[ true ]
Zombie: GET http://localhost:8000/app.php => 200
Zombie: Loaded document http://localhost:8000/app.php
Zombie: GET http://localhost:8000/app.php/js/0b50c2c.js => 200
PHPSESSID=jg9h8e2orbmbfq0dr65ni8ucs7; Domain=localhost; Path=/
[ true ]
Zombie: Event loop is empty

zombie.jsのバグですか?

4

1 に答える 1