php - Session conflicts when multiple fat-free-framework based apps are running on the same browser - Stack Overflow

When two F3 applications hosted on the same domain are running on the same browser, the session variabl

When two F3 applications hosted on the same domain are running on the same browser, the session variables are getting erased and hence causing conflicts.

Is there anyway I can create session namespaces in F3? Something like using the session_name() method in the native PHP sessions?

When two F3 applications hosted on the same domain are running on the same browser, the session variables are getting erased and hence causing conflicts.

Is there anyway I can create session namespaces in F3? Something like using the session_name() method in the native PHP sessions?

Share Improve this question edited Mar 13 at 15:20 libregeek asked Mar 13 at 14:27 libregeeklibregeek 1,29411 silver badges23 bronze badges 3
  • I'm not familiar with F3, but normally session cookies are related to domain names. Do your apps (websites?) share a domain? – KIKO Software Commented Mar 13 at 14:43
  • @KIKOSoftware Yes. it's hosted on the same domain. I updated my question. – libregeek Commented Mar 13 at 15:20
  • Well, PHP scrips, running under the same domain, share their session cookies, and therefore their session values in $_SESSION. That is, if F3 uses that. The solution would be to use different (sub)domains for different apps, or to write code in such a way that apps can share their sessions. – KIKO Software Commented Mar 13 at 16:06
Add a comment  | 

1 Answer 1

Reset to default 2

I'm going to guess for each of your apps you'll need to configure the JAR hive variable.

https://fatfreeframework/3.9/quick-reference#JAR

JAR

Type: array

Default cookie parameters. Consists of the following options:

  • expire Unix timestamp, when the cookie should expire. Default: 0

  • path The path on the server in which the cookie will be available. Default: '/'

  • domain The domain that the cookie is available to. Default: $_SERVER['SERVER_NAME'] if available, else ''

  • secure Set the cookie when a secure HTTPS connection exists. Default: $_SERVER['HTTPS']=='on'

  • httponly Make the cookie accessible only through the HTTP protocol. Default: TRUE

You can refer to session_set_cookie_params() in the PHP Manual for more information.

You can also watch a video that goes over using cookies in the Fat-Free Framework.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744695993a4588493.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信