使用Grunt运行laravel应用程序无法在本地环境中启动会话

时间:2015-07-29 10:43:31

标签: angularjs session gruntjs laravel-5 cors

我正在开发一个角度laravel应用程序。我有一种API工作流程。

enter image description here

角度应用程序位于angular文件夹中项目目录的根目录。这有构建工具和依赖关系管理工具,如bower和grunt。

我的 SELECT DISTINCT b.vertrek, b.reiscode, r.bestemming, r.dagen, r.prijs FROM boekingen b INNER JOIN reizen r ON b.reiscode = r.reiscode CROSS JOIN (SELECT MIN(vertrek) as minv, MAX(vertrek) as maxv FROM boekingen WHERE reiscode = 'JH10' ) bm WHERE b.reiscode <> 'JH10' AND b.vertrek BETWEEN DATEADD(day, -1, minv) and DATEADD(day, 1, minv) AND b.vertrek BETWEEN DATEADD(day, -1, maxv) AND DATEADD(day, 1, maxv) ORDER BY b.vertek; 已配置为在登录时对用户进行身份验证。

routes.php

当我同时调用这两条路线时,我总是将响应视为错误。 尝试在 Route::post('login','LoginController@auth'); Route::get('checkAuthentication','LoginController@isLoggedIn'); 方法中打印值,该方法登录用户,但会话不会持续存在。用户会立即被抛出到主页。  我通过运行Auth::attempt()使用grunt启动应用程序。这会在grunt serve上启动应用。我通过给出公共文件夹的路径来调整laravel路由,因为它们是laravel路由。
localhost:9000。这将检查数据库中的用户,但即使在添加CORS扩展后,也会立即销毁或不创建会话。没有错误显示。返回Example: localhost/project_dir/public/login,用户被重定向到主页。

false

以上是检查用户会话的路由的请求响应标头。

如何调试它来解决问题?是否有角度拒绝请求?更新
我尝试使用此link禁用 Remote Address:127.0.0.1:80 Request URL:http://localhost/project_dir/public/user/check Request Method:POST Status Code:200 OK Response Headers view source Access-Control-Allow-Origin:http://localhost:9000 Cache-Control:no-cache Connection:Keep-Alive Content-Length:4 Content-Type:text/html; charset=UTF-8 Date:Wed, 29 Jul 2015 10:30:33 GMT Keep-Alive:timeout=5, max=99 Server:Apache/2.4.9 (Win64) PHP/5.5.12 Set- Cookie:laravel_session=eyJpdiI6InlaVVlxUDRra3E1NXdcL25OekJvSlBRPT0iLCJ2YWx1ZSI6IlVaWGF6NmdsV1wvZ3NcL1FTVkR5Y2J3czlQNUkyaWdxZlJmeG5zK2U2c0lqM2VOMEY5S000cVwveTBVazBwVFNSZXlhZmhWSEUxUlRyMVJidE5TcE5jM2FBPT0iLCJtYWMiOiIzYzQ2YjJkMjVmMjZiODBiNzgwNmY3YjQ3NmMwOWI5MmM3NmFmZmNmMzY1MDFkNjFlMjg0MjQ0MzVjNGUyYTAzIn0%3D; expires=Wed, 29-Jul-2015 12:30:33 GMT; Max-Age=7200; path=/; domain=http://localhost:9000/; httponly Vary:Origin X-Powered-By:PHP/5.5.12 Request Headers view source Accept:application/json, text/plain, */* Accept-Encoding:gzip, deflate Accept-Language:en-US,en;q=0.8 Cache-Control:max-age=0 Connection:keep-alive Content-Length:0 Host:localhost Origin:http://localhost:9000 Referer:http://localhost:9000/ User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.107 Safari/537.36 FirePHP/4Chrome X-FirePHP-Version:0.0.6 X-Wf-Max-Combined-Size:261120 Cookie,但仍然没有运气

laravel_session

0 个答案:

没有答案