-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxcwidget_server.patch
59 lines (52 loc) · 1.61 KB
/
xcwidget_server.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
--- include/func/func.core.php
+++ include/func/func.core.php
@@ -2785,14 +2785,18 @@
}
}
-function func_setcookie($name, $value = '', $ttl = 0, $httponly = true)
+function func_setcookie($name, $value = '', $ttl = 0, $httponly = true, $onparentdomain = false)
{
global $xcart_http_host, $xcart_https_host, $HTTPS, $xcart_web_dir;
$webdir = (empty($xcart_web_dir) ? '/' : $xcart_web_dir);
- func_setcookie_raw($name, $value, $ttl, $webdir, $xcart_http_host, false, $httponly);
-
+ if ($onparentdomain == true) {
+ $new_cookie_domain = '.test.igennus.com'; //HACK!
+ func_setcookie_raw($name, $value, $ttl, $webdir, $new_cookie_domain, false, $httponly);
+ } else {
+ func_setcookie_raw($name, $value, $ttl, $webdir, $xcart_http_host, false, $httponly);
+ }
if ($xcart_http_host != $xcart_https_host)
func_setcookie_raw($name, $value, $ttl, $webdir, $xcart_https_host, $HTTPS, $httponly);
--- include/sessions.php
+++ include/sessions.php
@@ -390,7 +390,9 @@
$XCART_SESSION_EXPIRY = $expiry_time;
$XCARTSESSID = $sessid;
- func_setcookie($XCART_SESSION_NAME, $XCARTSESSID);
+ func_setcookie($XCART_SESSION_NAME, $XCARTSESSID, 0, true, true);
+ //Replaced by line above - use new argument in func/func.core.php to make session available from parent domain.
+ //func_setcookie($XCART_SESSION_NAME, $XCARTSESSID);
} // }}}
/**
--- info.php
+++ info.php
@@ -0,0 +1,18 @@
+<?php
+
+require './auth.php';
+
+//x_load(
+// 'cart',
+// 'product'
+//);
+
+x_session_register('cart');
+
+if ($cart) {
+ echo json_encode($cart);
+}
+return 0;
+
+?>
+