Lines Matching refs:name

30      * Checks the validity of a cookie name.
32 function validateCookieName(name){
33 if (!isString(name) || name === ""){
34 error("Cookie name must be a non-empty string.");
39 * Checks the validity of a subcookie name.
43 error("Subcookie name must be a non-empty string.");
60 * @param {String} name The name of the cookie.
69 _createCookieString : function (name /*:String*/, value /*:Variant*/, encodeValue /*:Boolean*/, options /*:Object*/) /*:String*/ {
73 var text /*:String*/ = encode(name) + "=" + (encodeValue ? encode(value) : value),
175 //check for normally-formatted cookie (name-value)
218 * Determines if the cookie with the given name exists. This is useful for
219 * Boolean cookies (those that do not follow the name=value convention).
220 * @param {String} name The name of the cookie to check.
225 exists: function(name) {
227 validateCookieName(name); //throws error
231 return cookies.hasOwnProperty(name);
235 * Returns the cookie value for the given name.
236 * @param {String} name The name of the cookie to retrieve.
249 get : function (name, options) {
251 validateCookieName(name); //throws error
268 cookie = cookies[name];
284 * @param {String} name The name of the cookie to retrieve.
285 * @param {String} subName The name of the subcookie to retrieve.
295 getSub : function (name /*:String*/, subName /*:String*/, converter /*:Function*/) /*:Variant*/ {
297 var hash /*:Variant*/ = this.getSubs(name);
319 * Returns an object containing name-value pairs stored in the cookie with the given name.
320 * @param {String} name The name of the cookie to retrieve.
321 * @return {Object} An object of name-value pairs if the cookie with the given name
326 getSubs : function (name) {
328 validateCookieName(name); //throws error
331 if (isString(cookies[name])){
332 return this._parseCookieHash(cookies[name]);
340 * @param {String} name The name of the cookie to remove.
349 remove : function (name, options) {
351 validateCookieName(name); //throws error
359 return this.set(name, "", options);
363 * Removes a sub cookie with a given name.
364 * @param {String} name The name of the cookie in which the subcookie exists.
365 * @param {String} subName The name of the subcookie to remove.
374 removeSub : function(name, subName, options) {
376 validateCookieName(name); //throws error
383 var subs = this.getSubs(name);
392 return this.setSubs(name, subs, options);
397 return this.setSubs(name, subs, options);
401 return this.remove(name, options);
410 * Sets a cookie with a given name and value.
411 * @param {String} name The name of the cookie to set.
421 set : function (name, value, options) {
423 validateCookieName(name); //throws error
431 var text = this._createCookieString(name, value, !options.raw, options);
437 * Sets a sub cookie with a given name to a particular value.
438 * @param {String} name The name of the cookie to set.
439 * @param {String} subName The name of the subcookie to set.
448 setSub : function (name, subName, value, options) {
450 validateCookieName(name); //throws error
458 var hash = this.getSubs(name);
466 return this.setSubs(name, hash, options);
471 * Sets a cookie with a given name to contain a hash of name-value pairs.
472 * @param {String} name The name of the cookie to set.
473 * @param {Object} value An object containing name-value pairs.
481 setSubs : function (name, value, options) {
483 validateCookieName(name); //throws error
489 var text /*:String*/ = this._createCookieString(name, this._createCookieHashString(value), false, options);