首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何进行正确的注销?

如何进行正确的注销?
EN

Stack Overflow用户
提问于 2018-08-12 22:00:51
回答 1查看 88关注 0票数 1

我使用post方法注销,并将响应重定向到主页,但为了获得主页的html,我需要使用get方法。

我应该如何正确地从post重定向到get?还有没有更合适的注销方法?

我使用Slim v3框架来解决这个问题,它不允许从一个方法重定向到另一个方法。

代码语言:javascript
复制
$app->get('/', function (Request $request, Response $response) {
    return $this->renderer->render($response, 'index.phtml');
});

$app->post('/logout', function (Request $request, Response $response) {
    return $this->model->logout($response)->withRedirect("/", 308);
});

据我所知,通过POST方法注销并通过GET获取html页面是最好的做法。

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51809518

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档