dongxing1965
2015-01-09 19:04
浏览 255
已采纳

是否有可能在请求的Set-Cookie中摆脱laravel_session?

I happen to notice that when I make a request to my API (written in Laravel framework), there is Set-Cookie:

  Set-Cookie: laravel_session=eyJpdiI6IlF5SDNLeGlRRTBFSlVJbXROSEZMWlE9PSIsInZhbHVlIjoiRlZXWVJrZERJN0tPRDU1TG40MGpJeURDQjRncUFYWGk4MjRBeFhMVHc3S2w5aW8yRFc1TCt4UWUzTEJnMTRpNkpYYkV6bnZ6Yk85RWF0MGIxaVhXYkE9PSIsIm1hYyI6ImRmNTc0MzRkZGM1ZDg0YWZkMWZjZThjOGI4Y2FlNTI2NjRhN2JjOGU0OTVkMWEwNTMwYTNlZmYxY2Y2ODNiMzkifQ%3D%3D; expires=Fri, 09-Jan-2015 20:49:47 GMT; Max-Age=7200; path=/; httponly

How can I get rid of it or block my Laravel API to not use it? It is possible can add a script in that laravel_session value.

Also, how do I avoid my app to consume the cookie set by the request?

图片转代码服务由CSDN问答提供 功能建议

我碰巧注意到当我向我的API发出请求(用Laravel框架编写)时,有Set- 饼干:

 <代码>设置Cookie:laravel_session = eyJpdiI6IlF5SDNLeGlRRTBFSlVJbXROSEZMWlE9PSIsInZhbHVlIjoiRlZXWVJrZERJN0tPRDU1TG40MGpJeURDQjRncUFYWGk4MjRBeFhMVHc3S2w5aW8yRFc1TCt4UWUzTEJnMTRpNkpYYkV6bnZ6Yk85RWF0MGIxaVhXYkE9PSIsIm1hYyI6ImRmNTc0MzRkZGM1ZDg0YWZkMWZjZThjOGI4Y2FlNTI2NjRhN2JjOGU0OTVkMWEwNTMwYTNlZmYxY2Y2ODNiMzkifQ%3D%3D; 到期=星期五,09-Jan-2015 20:49:47 GMT; 最大年龄= 7200; 路径= /;  httponly 
   
 
 

如何摆脱它或阻止我的Laravel API不使用它? 可以在laravel_session值中添加脚本。

另外,如何避免我的应用程序使用请求设置的cookie?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doutaoer3148 2015-01-09 19:07
    已采纳

    You can disable session cookies for the whole application by changing the session driver to array

    In app/config/session.php:

    'driver' => 'array'
    
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题