Session变量获得preSS Ctrl + F5后,PayPal和收到值之后空 [英] Session variable get empty after paypal and recieve value after press ctrl+f5

查看:205
本文介绍了Session变量获得preSS Ctrl + F5后,PayPal和收到值之后空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到奇怪的局面:在我的会话变量设置为来自PayPal回来后空一次。

I faced weird situation where my session variable set it to null once after coming back from PayPal.

在之前重定向页面我的情况给PayPal我分配值会话。

In my scenario before redirect page to PayPal i assign value to session.

 public string sessionToken
        {
            get
            {
                if (Session["token"] != null)
                {
                    return Session["token"].ToString();
                }
                else
                    return string.Empty;
            }
            set
            {
                Session["token"] = value;
            }
        }

致电贝宝:

 bool ret = payPalCaller.ShortcutExpressCheckout(amt, ref token, ref retMsg, ref status);
 if (ret)
    {
          sessionToken = token;
          Response.Redirect(retMsg,false);
     }

在用户完全的贝宝(如果用户需要一些时间才能完成TXN)并返回到sucess页面,并从那里我试图上述会话变量的访问,则该值为空。但如果我preSS Ctrl + F5 几次那么它获得价值。
什么是这里的问题?
在我的开发PC,这是工作正常,当我在服务器托管问题发生。 (IIS 6)

after user complete paypal (if user takes some time to complete txn) and return back to sucess page and from there i'm trying to access above session variable, then that value is empty. but if i press ctrl+f5 few times then it get value. what is the problem in here? in my development pc, this is working fine and problem occurs when i hosted in server. (IIS 6)

我的web配置的配置如下:

My web config configuration as follows:

<configuration>
  <location path="RegisterUser.aspx">
    <system.web>
      <authorization>
        <allow users="?" />
      </authorization>
      <httpRuntime executionTimeout="43200" maxRequestLength="104856" />
      <sessionState timeout="3600" mode="InProc" cookieless="false"></sessionState>
      <customErrors mode="ON" />
    </system.web>
  </location>
</configuration>

编辑:

我已经在<二手类似code href=\"http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/checkout-and-payment-with-paypal\"相对=nofollow>结算和付款使用贝宝。我发现在注释部分中提到这个奇怪的问题,但这个问题也没有回答。

i have used similar code in Checkout and Payment with PayPal. i found this weird question mentioned in the comment section, but no reply for that question as well.

推荐答案

如果pressing <大骨节病> CTRL + <大骨节病> F5 修复该问题的你那么你的成功页面可能只是被缓存。试试你的成功页面上禁用缓存,这可能只是做的伎俩。您可以参考以下链接供参考:<一href=\"http://stackoverflow.com/questions/914027/disabling-browser-caching-for-all-browsers-from-asp-net\">Disabling浏览器缓存从ASP.NET所有的浏览器

If pressing ctrl+F5 fixes the issue for you then your success page may just be cached. Try disabling cache on your success page, that might just do the trick. You can refer to this link for reference: Disabling browser caching for all browsers from ASP.NET

这篇关于Session变量获得preSS Ctrl + F5后,PayPal和收到值之后空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆