fixed cookie session issue. closes #1297