小编rar*_*rrr的帖子

为什么我的AJAX请求没有扩展OWIN MVC会话?

我们有一个ASP.NET MVC 5应用程序,它一直使用带有滑动过期的表单身份验证.我们最近切换到OWIN Cookie身份验证,并且遇到了我们的会话无法正常扩展的问题.

以前,可以从AJAX xhr请求扩展会话.但是,使用此配置,它们不会扩展.即使在服务器终止会话之后,我也会收到应该扩展的每个请求(GET和POST)的200.

目前的设置是:

app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);

UrlHelper url = new UrlHelper(HttpContext.Current.Request.RequestContext);
app.UseCookieAuthentication(new CookieAuthenticationOptions()
{
   AuthenticationType = "Cookies",
   CookieSecure = CookieSecureOption.SameAsRequest,
   CookieName = Constants.CatalystPortalCookieName,
   LoginPath = new PathString(url.Action(nameof(LoginController.Index), "Login")),
   SlidingExpiration = true,
   ExpireTimeSpan = TimeSpan.FromMinutes(20),
   CookiePath = "/",
});
Run Code Online (Sandbox Code Playgroud)

但是,如果单击导致整个页面作为文档响应加载的链接,则服务器会正​​确扩展会话.

c# ajax asp.net-mvc session-timeout owin

12
推荐指数
1
解决办法
1997
查看次数

我的git rebase工作流程出了什么问题?

我的团队正在从git merge工作流转向rebase工作流,我不明白我做错了什么.我主要是从这篇博文作为模板.最终,希望能够提交一个github pull请求,其中包含来自我的分支的提交,该请求与master没有合并冲突.如果拉请求只能包含我的提交(用于代码审查),那就太好了.

方案如下:

  1. 我为我的功能创建了一个master的分支
  2. 做一些工作...
  3. 我从主人到我当地的分支机构:

    git fetch
    git rebase origin/master
    
    Run Code Online (Sandbox Code Playgroud)
  4. 我处理任何合并冲突,然后继续变基

    git mergetool
    git rebase --continue
    
    Run Code Online (Sandbox Code Playgroud)
  5. 因为我是唯一一个在我的分支上工作的人,所以我希望能够将我当前的状态推到一起

    git push origin myBranch
    
    Run Code Online (Sandbox Code Playgroud)
  6. 但是,当我尝试推动时,我得到以下内容

    $ git push origin myBranch 
    To <github address>
     ! [rejected]        myBranch -> myBranch (non-fast-forward)
    error: failed to push some refs to <github address>
    hint: Updates were rejected because the tip of your current branch is behind
    hint: its remote counterpart. Integrate the remote changes (e.g.
    hint: 'git pull ...') before pushing again.
    hint: See …
    Run Code Online (Sandbox Code Playgroud)

git github git-rebase

6
推荐指数
1
解决办法
1700
查看次数

标签 统计

ajax ×1

asp.net-mvc ×1

c# ×1

git ×1

git-rebase ×1

github ×1

owin ×1

session-timeout ×1