Valerii Vasin (valerii) wrote in changelog,
Valerii Vasin
valerii
changelog

[livejournal] r23411: LJSUP-14469: Cookie function should retu...

Committer: vvasin
LJSUP-14469: Cookie function should return value when set value.
U   trunk/htdocs/js/basic.js
Modified: trunk/htdocs/js/basic.js
===================================================================
--- trunk/htdocs/js/basic.js	2012-12-04 07:49:52 UTC (rev 23410)
+++ trunk/htdocs/js/basic.js	2012-12-04 08:28:24 UTC (rev 23411)
@@ -25,8 +25,10 @@
 		// in the packed version for some reason...
 		var path = options.path ? '; path=' + (options.path) : '',
 			domain = options.domain ? '; domain=' + (options.domain) : '',
-			secure = options.secure ? '; secure' : '';
-		document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
+			secure = options.secure ? '; secure' : '',
+			cookieValue = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
+		document.cookie = cookieValue;
+		return cookieValue;
 	} else { // only name given, get cookie
 		var cookieValue = null;
 		if (document.cookie && document.cookie != '') {

Tags: invis89, js, livejournal, vvasin
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments