File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 1111?>
1212<script data-mfmofile="true">
1313 window.MagefanJs = window.MagefanJs || {};
14- window.MagefanJs.setCookies = function setCookies(options) {
15- options = options || {};
16- if (!options.name || !options.value) {
14+ window.MagefanJs.setCookie = function(name, value, params) {
15+ if (!name) {
1716 return;
1817 }
19- var expires = options.expires;
20- var path = options.path || '/';
21- var domain = options.domain || window.location.hostname;
2218
23- var cookieString = encodeURIComponent(options.name) + '=' + encodeURIComponent(options.value);
19+ params = params || {};
20+
21+ var expires = params.expires;
22+ var path = params.path || '/';
23+ var domain = params.domain || window.location.hostname;
24+
25+ var cookieString = encodeURIComponent(name) + '=' + encodeURIComponent(value);
2426
2527 if (expires instanceof Date) {
2628 cookieString += '; expires=' + expires.toUTCString();
You can’t perform that action at this time.
0 commit comments