是否可以清除不同会话的变量? [英] Is it possible to clear a different session's variable?

查看:59
本文介绍了是否可以清除不同会话的变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 $_SESSION 上存储了一些信息,会话通过自定义会话处理程序存储在数据库中.

I have a some information stored on $_SESSION, the session is stored on the database through a custom session handler.

是否有一种标准方法可以模拟"具有会话 ID 的会话或从另一个会话中清除特定变量.

Is there a standard way to either 'impersonate' a session having a session id or clear specific variables from another session.

我问这个是因为我有我的网络应用程序,它的会话变量可以自己工作,这是一个实际的购物车,带有使用贝宝的订单信息.Paypal 通过 IPN(通知)返回付款响应,这是从他们的服务器向我的站点发出的请求.当然,这些请求会启动它们自己的会话.

I am asking about this because I have my web application, with its session variables on its own working, this is an actual shopping cart with order information using paypal. Paypal returns a response of a payment through IPN (Notifications), which are request made from their server to my site. Those requests, of course, initiate their own sessions.

我想要找到的是一种从看到不同会话的贝宝通知请求中清除原始会话变量的方法.有没有办法做到这一点?

What I want to find is a way to clear the original session variable from the paypal notification request that sees a different session. Is there a way to do that?

一个想法可能是手动编辑存储会话数据的数据库,但我想寻找一些标准的东西,而不考虑会话处理程序.

One idea might be to manually edit the database in which the session data is stored, but I want to look for something standard, regardless of the session handlers.

推荐答案

我问这个是因为我有我的网络应用程序,它的会话变量可以自己工作,这是一个实际的购物车,带有使用贝宝的订单信息.Paypal 通过 IPN(通知)返回付款响应,这是从他们的服务器向我的站点发出的请求.当然,这些请求会启动它们自己的会话.

I am asking about this because I have my web application, with its session variables on its own working, this is an actual shopping cart with order information using paypal. Paypal returns a response of a payment through IPN (Notifications), which are request made from their server to my site. Those requests, of course, initiate their own sessions.

我想要找到的是一种从看到不同会话的贝宝通知请求中清除原始会话变量的方法.有没有办法做到这一点?

What I want to find is a way to clear the original session variable from the paypal notification request that sees a different session. Is there a way to do that?

如果您发现自己需要在其他人的会话中编辑数据,则不应在开始时将该数据存储在会话中.

If you've found yourself needing to edit data in someone else's session, you shouldn't be storing that data in a session to begin with.

如果您需要阅读或以其他方式使用 IPN,也许您应该将它们存储在数据库中的实际表中.您可以将该行与用户的会话 ID 相关联,或者最好与他们的登录名或电子邮件地址相关联.

If you need to read or otherwise work with the IPNs, perhaps you should store them in the database in an actual table. You can associate the row with the user's session ID, or preferably with their login or email address.

这篇关于是否可以清除不同会话的变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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