Sunday, December 31, 2017

HTTP cookie

Abstract Word Cloud For HTTP Cookie With Related Tags And Terms ...
src: previews.123rf.com

An HTTP cookie (also called web cookie, Internet cookie, browser cookie, or simply cookie) is a small piece of data sent from a website and stored on the user's computer by the user's web browser while the user is browsing. Cookies were designed to be a reliable mechanism for websites to remember stateful information (such as items added in the shopping cart in an online store) or to record the user's browsing activity (including clicking particular buttons, logging in, or recording which pages were visited in the past). They can also be used to remember arbitrary pieces of information that the user previously entered into form fields such as names, addresses, passwords, and credit card numbers.

Other kinds of cookies perform essential functions in the modern web. Perhaps most importantly, authentication cookies are the most common method used by web servers to know whether the user is logged in or not, and which account they are logged in with. Without such a mechanism, the site would not know whether to send a page containing sensitive information, or require the user to authenticate themselves by logging in. The security of an authentication cookie generally depends on the security of the issuing website and the user's web browser, and on whether the cookie data is encrypted. Security vulnerabilities may allow a cookie's data to be read by a hacker, used to gain access to user data, or used to gain access (with the user's credentials) to the website to which the cookie belongs (see cross-site scripting and cross-site request forgery for examples).

The tracking cookies, and especially third-party tracking cookies, are commonly used as ways to compile long-term records of individuals' browsing histories - a potential privacy concern that prompted European and U.S. lawmakers to take action in 2011. European law requires that all websites targeting European Union member states gain "informed consent" from users before storing non-essential cookies on their device.


Video HTTP cookie



Background

Origin of the name

The term "cookie" was coined by web browser programmer Lou Montulli. It was derived from the term "magic cookie", which is a packet of data a program receives and sends back unchanged, used by Unix programmers.

History

Magic cookies were already used in computing when computer programmer Lou Montulli had the idea of using them in web communications in June 1994. At the time, he was an employee of Netscape Communications, which was developing an e-commerce application for MCI. Vint Cerf and John Klensin represented MCI in technical discussions with Netscape Communications. MCI did not want its servers to have to retain partial transaction states, which led them to ask Netscape to find a way to store that state in each user's computer instead. Cookies provided a solution to the problem of reliably implementing a virtual shopping cart.

Together with John Giannandrea, Montulli wrote the initial Netscape cookie specification the same year. Version 0.9beta of Mosaic Netscape, released on October 13, 1994, supported cookies. The first use of cookies (out of the labs) was checking whether visitors to the Netscape website had already visited the site. Montulli applied for a patent for the cookie technology in 1995, and US 5774670  was granted in 1998. Support for cookies was integrated in Internet Explorer in version 2, released in October 1995.

The introduction of cookies was not widely known to the public at the time. In particular, cookies were accepted by default, and users were not notified of their presence. The general public learned about cookies after the Financial Times published an article about them on February 12, 1996. In the same year, cookies received a lot of media attention, especially because of potential privacy implications. Cookies were discussed in two U.S. Federal Trade Commission hearings in 1996 and 1997.

The development of the formal cookie specifications was already ongoing. In particular, the first discussions about a formal specification started in April 1995 on the www-talk mailing list. A special working group within the Internet Engineering Task Force (IETF) was formed. Two alternative proposals for introducing state in HTTP transactions had been proposed by Brian Behlendorf and David Kristol respectively. But the group, headed by Kristol himself and Lou Montulli, soon decided to use the Netscape specification as a starting point. In February 1996, the working group identified third-party cookies as a considerable privacy threat. The specification produced by the group was eventually published as RFC 2109 in February 1997. It specifies that third-party cookies were either not allowed at all, or at least not enabled by default.

At this time, advertising companies were already using third-party cookies. The recommendation about third-party cookies of RFC 2109 was not followed by Netscape and Internet Explorer. RFC 2109 was superseded by RFC 2965 in October 2000.

RFC 2965 added a Set-Cookie2 header, which informally came to be called "RFC 2965-style cookies" as opposed to the original Set-Cookie header which was called "Netscape-style cookies". Set-Cookie2 was seldom used however, and was deprecated in RFC 6265 in April 2011 which was written as a definitive specification for cookies as used in the real world.


Maps HTTP cookie



Terminology

Session cookie

A session cookie, also known as an in-memory cookie or transient cookie, exists only in temporary memory while the user navigates the website. Web browsers normally delete session cookies when the user closes the browser. Unlike other cookies, session cookies do not have an expiration date assigned to them, which is how the browser knows to treat them as session cookies.

Persistent cookie

Instead of expiring when the web browser is closed as session cookies do, a persistent cookie expires at a specific date or after a specific length of time. This means that, for the cookie's entire lifespan (which can be as long or as short as its creators want), its information will be transmitted to the server every time the user visits the website that it belongs to, or every time the user views a resource belonging to that website from another website (such as an advertisement).

For this reason, persistent cookies are sometimes referred to as tracking cookies because they can be used by advertisers to record information about a user's web browsing habits over an extended period of time. However, they are also used for "legitimate" reasons (such as keeping users logged into their accounts on websites, to avoid re-entering login credentials at every visit).

These cookies are however reset if the expiration time is reached or the user manually deletes the cookie.

Secure cookie

A secure cookie can only be transmitted over an encrypted connection (i.e. HTTPS). They cannot be transmitted over unencrypted connections (i.e. HTTP). This makes the cookie less likely to be exposed to cookie theft via eavesdropping. A cookie is made secure by adding the Secure flag to the cookie.

HttpOnly cookie

An HttpOnly cookie cannot be accessed by client-side APIs, such as JavaScript. This restriction eliminates the threat of cookie theft via cross-site scripting (XSS). However, the cookie remains vulnerable to cross-site tracing (XST) and cross-site request forgery (XSRF) attacks. A cookie is given this characteristic by adding the HttpOnly flag to the cookie.

SameSite cookie

Google Chrome 51 recently introduced a new kind of cookie which can only be sent in requests originating from the same origin as the target domain. This restriction mitigates attacks such as cross-site request forgery (XSRF). A cookie is given this characteristic by setting the SameSite flag to Strict or Lax.

Third-party cookie

Normally, a cookie's domain attribute will match the domain that is shown in the web browser's address bar. This is called a first-party cookie. A third-party cookie, however, belongs to a domain different from the one shown in the address bar. This sort of cookie typically appears when web pages feature content from external websites, such as banner advertisements. This opens up the potential for tracking the user's browsing history, and is often used by advertisers in an effort to serve relevant advertisements to each user.

As an example, suppose a user visits www.example.org. This web site contains an advertisement from ad.foxytracking.com, which, when downloaded, sets a cookie belonging to the advertisement's domain (ad.foxytracking.com). Then, the user visits another website, www.foo.com, which also contains an advertisement from ad.foxytracking.com, and which also sets a cookie belonging to that domain (ad.foxytracking.com). Eventually, both of these cookies will be sent to the advertiser when loading their advertisements or visiting their website. The advertiser can then use these cookies to build up a browsing history of the user across all the websites that have ads from this advertiser.

As of 2014, some websites were setting cookies readable for over 100 third-party domains. On average, a single website was setting 10 cookies, with a maximum number of cookies (first- and third-party) reaching over 800.

Most modern web browsers contain privacy settings that can block third-party cookies.

Supercookie

A supercookie is a cookie with an origin of a top-level domain (such as .com) or a public suffix (such as .co.uk). Ordinary cookies, by contrast, have an origin of a specific domain name, such as example.com.

Supercookies can be a potential security concern and are therefore often blocked by web browsers. If unblocked by the browser, an attacker in control of a malicious website could set a supercookie and potentially disrupt or impersonate legitimate user requests to another website that shares the same top-level domain or public suffix as the malicious website. For example, a supercookie with an origin of .com, could maliciously affect a request made to example.com, even if the cookie did not originate from example.com. This can be used to fake logins or change user information.

The Public Suffix List helps to mitigate the risk that supercookies pose. The Public Suffix List is a cross-vendor initiative that aims to provide an accurate and up-to-date list of domain name suffixes. Older versions of browsers may not have an up-to-date list, and will therefore be vulnerable to supercookies from certain domains.

Other uses

The term "supercookie" is sometimes used for tracking technologies that do not rely on HTTP cookies. Two such "supercookie" mechanisms were found on Microsoft websites in August 2011: cookie syncing that respawned MUID (machine unique identifier) cookies, and ETag cookies. Due to media attention, Microsoft later disabled this code.

Zombie cookie

A zombie cookie is a cookie that is automatically recreated after being deleted. This is accomplished by storing the cookie's content in multiple locations, such as Flash Local shared object, HTML5 Web storage, and other client-side and even server-side locations. When the cookie's absence is detected, the cookie is recreated using the data stored in these locations.


11th JMeter Training Video - HTTP Cookie Manager - YouTube
src: i.ytimg.com


Structure

A cookie consists of the following components:

  1. Name
  2. Value
  3. Zero or more attributes (name/value pairs). Attributes store information such as the cookie's expiration, domain, and flags (such as Secure and HttpOnly).

HTTP cookie Manager in Apache JMeter | ExamsMyantra
src: s3.ap-south-1.amazonaws.com


Uses

Session management

Cookies were originally introduced to provide a way for users to record items they want to purchase as they navigate throughout a website (a virtual "shopping cart" or "shopping basket"). Today, however, the contents of a user's shopping cart are usually stored in a database on the server, rather than in a cookie on the client. To keep track of which user is assigned to which shopping cart, the server sends a cookie to the client that contains a unique session identifier (typically, a long string of random letters and numbers). Because cookies are sent to the server with every request the client makes, that session identifier will be sent back to the server every time the user visits a new page on the website, which lets the server know which shopping cart to display to the user.

Another popular use of cookies is for logging into websites. When the user visits a website's login page, the web server typically sends the client a cookie containing a unique session identifier. When the user successfully logs in, the server remembers that that particular session identifier has been authenticated, and grants the user access to its services.

Because session cookies only contain a unique session identifier, this makes the amount of personal information that a website can save about each user virtually limitless--the website is not limited to restrictions concerning how large a cookie can be. Session cookies also help to improve page load times, since the amount of information in a session cookie is small and requires little bandwidth.

Personalization

Cookies can be used to remember information about the user in order to show relevant content to that user over time. For example, a web server might send a cookie containing the username last used to log into a website so that it may be filled in automatically the next time the user logs in.

Many websites use cookies for personalization based on the user's preferences. Users select their preferences by entering them in a web form and submitting the form to the server. The server encodes the preferences in a cookie and sends the cookie back to the browser. This way, every time the user accesses a page on the website, the server can personalize the page according to the user's preferences. For example, the Google search engine once used cookies to allow users (even non-registered ones) to decide how many search results per page they wanted to see. Also, DuckDuckGo uses cookies to allow users to set the viewing preferences like colors of the web page.

Tracking

Tracking cookies are used to track users' web browsing habits. This can also be done to some extent by using the IP address of the computer requesting the page or the referer field of the HTTP request header, but cookies allow for greater precision. This can be demonstrated as follows:

  1. If the user requests a page of the site, but the request contains no cookie, the server presumes that this is the first page visited by the user. So the server creates a unique identifier (typically a string of random letters and numbers) and sends it as a cookie back to the browser together with the requested page.
  2. From this point on, the cookie will automatically be sent by the browser to the server every time a new page from the site is requested. The server sends the page as usual, but also stores the URL of the requested page, the date/time of the request, and the cookie in a log file.

By analyzing this log file, it is then possible to find out which pages the user has visited, in what sequence, and for how long.

Corporations exploit users' web habits by tracking cookies to collect information about buying habits. The Wall Street Journal found that America's top fifty websites installed an average of sixty-four pieces of tracking technology onto computers resulting in a total of 3,180 tracking files. The data can then be collected and sold to bidding corporations.


HTTP Methods. Authentication & Cookie basics - YouTube
src: i.ytimg.com


Implementation

Cookies are arbitrary pieces of data, usually chosen and first sent by the web server, and stored on the client computer by the web browser. The browser then sends them back to the server with every request, introducing states (memory of previous events) into otherwise stateless HTTP transactions. Without cookies, each retrieval of a web page or component of a web page would be an isolated event, largely unrelated to all other page views made by the user on the website. Although cookies are usually set by the web server, they can also be set by the client using a scripting language such as JavaScript (unless the cookie's HttpOnly flag is set, in which case the cookie cannot be modified by scripting languages).

The cookie specifications require that browsers meet the following requirements in order to support cookies:

  • Can support cookies as large as 4,096 bytes in size.
  • Can support at least 50 cookies per domain (i.e. per website).
  • Can support at least 3,000 cookies in total.

Setting a cookie

Cookies are set using the Set-Cookie HTTP header, sent in an HTTP response from the web server. This header instructs the web browser to store the cookie and send it back in future requests to the server (the browser will, of course, ignore this header if it does not support cookies or has disabled cookies).

As an example, the browser sends its first request for the homepage of the www.example.org website:

The server responds with two Set-Cookie headers:

The server's HTTP response contains the contents of the website's homepage. But it also instructs the browser to set two cookies. The first, "theme", is considered to be a session cookie, since it does not have an Expires or Max-Age attribute. Session cookies are intended to be deleted by the browser when the browser closes. The second, "sessionToken" is considered to be a persistent cookie, since it contains an Expires attribute, which instructs the browser to delete the cookie at a specific date and time.

Next, the browser sends another request to visit the spec.html page on the website. This request contains a Cookie HTTP header, which contains the two cookies that the server instructed the browser to set:

This way, the server knows that this request is related to the previous one. The server would answer by sending the requested page, possibly including more Set-Cookie headers in the response in order to add new cookies, modify existing cookies, or delete cookies.

The value of a cookie can be modified by the server by including a Set-Cookie header in response to a page request. The browser then replaces the old value with the new value.

The value of a cookie may consist of any printable ASCII character (! through ~, Unicode \u0021 through \u007E) excluding , and ; and whitespace characters. The name of a cookie excludes the same characters, as well as =, since that is the delimiter between the name and value. The cookie standard RFC 2965 is more restrictive but not implemented by browsers.

The term "cookie crumb" is sometimes used to refer to a cookie's name-value pair.

Cookies can also be set by scripting languages such as JavaScript that run within the browser. In JavaScript, the object document.cookie is used for this purpose. For example, the instruction document.cookie = "temperature=20" creates a cookie of name "temperature" and value "20".

Cookie attributes

In addition to a name and value, cookies can also have one or more attributes. Browsers do not include cookie attributes in requests to the server--they only send the cookie's name and value. Cookie attributes are used by browsers to determine when to delete a cookie, block a cookie or whether to send a cookie to the server.

Domain and path

The Domain and Path attributes define the scope of the cookie. They essentially tell the browser what website the cookie belongs to. For obvious security reasons, cookies can only be set on the current resource's top domain and its sub domains, and not for another domain and its sub domains. For example, the website example.org cannot set a cookie that has a domain of foo.com because this would allow the example.org website to control the cookies of foo.com.

If a cookie's Domain and Path attributes are not specified by the server, they default to the domain and path of the resource that was requested. However, in most browsers there is a difference between a cookie set from foo.com without a domain, and a cookie set with the foo.com domain. In the former case, the cookie will only be sent for requests to foo.com, also known as a host-only cookie. In the latter case, all sub domains are also included (for example, docs.foo.com). A notable exception to this general rule is Internet Explorer, which always sends cookies to sub domains regardless of whether the cookie was set with or without a domain.

Below is an example of some Set-Cookie HTTP response headers that are sent from a website after a user logged in. The HTTP request was sent to a webpage within the docs.foo.com subdomain:

The first cookie, LSID, has no Domain attribute, and has a Path attribute set to /accounts. This tells the browser to use the cookie only when requesting pages contained in docs.foo.com/accounts (the domain is derived from the request domain). The other two cookies, HSID and SSID, would be used when the browser requests any subdomain in .foo.com on any path (for example www.foo.com/bar). The prepending dot is optional in recent standards, but can be added for compatibility with RFC 2109 based implementations.

Expires and Max-Age

The Expires attribute defines a specific date and time for when the browser should delete the cookie. The date and time are specified in the form Wdy, DD Mon YYYY HH:MM:SS GMT, or in the form Wdy, DD Mon YY HH:MM:SS GMT for values of YY where YY is greater than or equal to 0 and less than or equal to 69.

Alternatively, the Max-Age attribute can be used to set the cookie's expiration as an interval of seconds in the future, relative to the time the browser received the cookie. Below is an example of three Set-Cookie headers that were received from a website after a user logged in:

The first cookie, lu, is set to expire sometime on 15 January 2013. It will be used by the client browser until that time. The second cookie, made_write_conn, does not have an expiration date, making it a session cookie. It will be deleted after the user closes their browser. The third cookie, reg_fb_gate, has its value changed to "deleted", with an expiration time in the past. The browser will delete this cookie right away because its expiration time is in the past. Note that cookie will only be deleted if the domain and path attributes in the Set-Cookie field match the values used when the cookie was created.

As of 2016 Internet Explorer did not support Max-Age.

Secure and HttpOnly

The Secure and HttpOnly attributes do not have associated values. Rather, the presence of just their attribute names indicates that their behaviors should be enabled.

The Secure attribute is meant to keep cookie communication limited to encrypted transmission, directing browsers to use cookies only via secure/encrypted connections. However, if a web server sets a cookie with a secure attribute from a non-secure connection, the cookie can still be intercepted when it is sent to the user by man-in-the-middle attacks. Therefore, for maximum security, cookies with the Secure attribute should only be set over a secure connection.

The HttpOnly attribute directs browsers not to expose cookies through channels other than HTTP (and HTTPS) requests. This means that the cookie cannot be accessed via client-side scripting languages (notably JavaScript), and therefore cannot be stolen easily via cross-site scripting (a pervasive attack technique).


CookiesA cookie, also known as
src: image.slidesharecdn.com


Browser settings

Most modern browsers support cookies and allow the user to disable them. The following are common options:

  • To enable or disable cookies completely, so that they are always accepted or always blocked.
  • To view and selectively delete cookies using a cookie manager.
  • To fully wipe all private data, including cookies.

By default, Internet Explorer allows third-party cookies only if they are accompanied by a P3P "CP" (Compact Policy) field.

Add-on tools for managing cookie permissions also exist.


Bypass HTTP Only Cookie during XSS exploitation - YouTube
src: i.ytimg.com


Privacy and third-party cookies

Cookies have some important implications on the privacy and anonymity of web users. While cookies are sent only to the server setting them or a server in the same Internet domain, a web page may contain images or other components stored on servers in other domains. Cookies that are set during retrieval of these components are called third-party cookies. The older standards for cookies, RFC 2109 and RFC 2965, specify that browsers should protect user privacy and not allow sharing of cookies between servers by default. However, the newer standard, RFC 6265, explicitly allows user agents to implement whichever third-party cookie policy they wish. Most browsers, such as Mozilla Firefox, Internet Explorer, Opera and Google Chrome do allow third-party cookies by default, as long as the third-party website has Compact Privacy Policy published. Newer versions of Safari block third-party cookies, and this is planned for Mozilla Firefox as well (initially planned for version 22 but was postponed indefinitely).

Advertising companies use third-party cookies to track a user across multiple sites. In particular, an advertising company can track a user across all pages where it has placed advertising images or web bugs. Knowledge of the pages visited by a user allows the advertising company to target advertisements to the user's presumed preferences.

Website operators who do not disclose third-party cookie use to consumers run the risk of harming consumer trust if cookie use is discovered. Having clear disclosure (such as in a privacy policy) tends to eliminate any negative effects of such cookie discovery.

The possibility of building a profile of users is a privacy threat, especially when tracking is done across multiple domains using third-party cookies. For this reason, some countries have legislation about cookies.

The United States government has set strict rules on setting cookies in 2000 after it was disclosed that the White House drug policy office used cookies to track computer users viewing its online anti-drug advertising. In 2002, privacy activist Daniel Brandt found that the CIA had been leaving persistent cookies on computers which had visited its website. When notified it was violating policy, CIA stated that these cookies were not intentionally set and stopped setting them. On December 25, 2005, Brandt discovered that the National Security Agency (NSA) had been leaving two persistent cookies on visitors' computers due to a software upgrade. After being informed, the NSA immediately disabled the cookies.

EU cookie directive

In 2002, the European Union launched the Directive on Privacy and Electronic Communications, a policy requiring end users' consent for the placement of cookies, and similar technologies for storing and accessing information on users' equipment. In particular, Article 5 Paragraph 3 mandates that storing data in a user's computer can only be done if the user is provided information about how this data is used, and the user is given the possibility of denying this storing operation.

Directive 95/46/EC defines "the data subject's consent" as "any freely given specific and informed indication of his wishes by which the data subject signifies his agreement to personal data relating to him being processed." Consent must involve some form of communication where individuals knowingly indicate their acceptance.

In 2009, the policy was amended by Directive 2009/136/EC, which included a change to Article 5, Paragraph 3. Instead of having an option for users to opt out of cookie storage, the revised Directive requires consent to be obtained for cookie storage.

In June 2012, European data protection authorities adopted an opinion which clarifies that some cookie users might be exempt from the requirement to gain consent:

  • Some cookies can be exempted from informed consent under certain conditions if they are not used for additional purposes. These cookies include cookies used to keep track of a user's input when filling online forms or as a shopping cart.
  • First party analytics cookies are not likely to create a privacy risk if websites provide clear information about the cookies to users and privacy safeguards.

The industry's response has been largely negative. Robert Bond of the law firm Speechly Bircham describes the effects as "far-reaching and incredibly onerous" for "all UK companies". Simon Davis of Privacy International argues that proper enforcement would "destroy the entire industry".

The P3P specification offers possibility for a server to state a privacy policy using an HTTP header, which specifies which kind of information it collects and for which purpose. These policies include (but are not limited to) the use of information gathered using cookies. According to the P3P specification, a browser can accept or reject cookies by comparing the privacy policy with the stored user preferences or ask the user, presenting them the privacy policy as declared by the server. However, the P3P specification was criticized by web developers for its complexity. Some websites do not correctly implement it. For example, Facebook jokingly used "HONK" as its P3P header for a period. Only Internet Explorer provides adequate support for the specification.

Third-party cookies can be blocked by most browsers to increase privacy and reduce tracking by advertising and tracking companies without negatively affecting the user's web experience. Many advertising operators have an opt-out option to behavioural advertising, with a generic cookie in the browser stopping behavioural advertising.


Study Material: F5 BIG-IP LTM Load balancer Cookie Persistence
src: 1.bp.blogspot.com


Cookie theft and session hijacking

Most websites use cookies as the only identifiers for user sessions, because other methods of identifying web users have limitations and vulnerabilities. If a website uses cookies as session identifiers, attackers can impersonate users' requests by stealing a full set of victims' cookies. From the web server's point of view, a request from an attacker then has the same authentication as the victim's requests; thus the request is performed on behalf of the victim's session.

Listed here are various scenarios of cookie theft and user session hijacking (even without stealing user cookies) which work with websites which rely solely on HTTP cookies for user identification.

Network eavesdropping

Traffic on a network can be intercepted and read by computers on the network other than the sender and receiver (particularly over unencrypted open Wi-Fi). This traffic includes cookies sent on ordinary unencrypted HTTP sessions. Where network traffic is not encrypted, attackers can therefore read the communications of other users on the network, including HTTP cookies as well as the entire contents of the conversations, for the purpose of a man-in-the-middle attack.

An attacker could use intercepted cookies to impersonate a user and perform a malicious task, such as transferring money out of the victim's bank account.

This issue can be resolved by securing the communication between the user's computer and the server by employing Transport Layer Security (HTTPS protocol) to encrypt the connection. A server can specify the Secure flag while setting a cookie, which will cause the browser to send the cookie only over an encrypted channel, such as an SSL connection.

Publishing false sub-domain: DNS cache poisoning

If an attacker is able to cause a DNS server to cache a fabricated DNS entry (called DNS cache poisoning), then this could allow the attacker to gain access to a user's cookies. For example, an attacker could use DNS cache poisoning to create a fabricated DNS entry of f12345.www.example.com that points to the IP address of the attacker's server. The attacker can then post an image URL from his own server (for example, http://f12345.www.example.com/img_4_cookie.jpg). Victims reading the attacker's message would download this image from f12345.www.example.com. Since f12345.www.example.com is a sub-domain of www.example.com, victims' browsers would submit all example.com-related cookies to the attacker's server.

If an attacker is able to accomplish this, it is usually the fault of the Internet Service Providers for not properly securing their DNS servers. However, the severity of this attack can be lessened if the target website uses secure cookies. In this case, the attacker would have the extra challenge of obtaining the target website's SSL certificate from a certificate authority, since secure cookies can only be transmitted over an encrypted connection. Without a matching SSL certificate, victims' browsers would display a warning message about the attacker's invalid certificate, which would help deter users from visiting the attacker's fraudulent website and sending the attacker their cookies.

Cross-site scripting: cookie theft

Cookies can also be stolen using a technique called cross-site scripting. This occurs when an attacker takes advantage of a website that allows its users to post unfiltered HTML and JavaScript content. By posting malicious HTML and JavaScript code, the attacker can cause the victim's web browser to send the victim's cookies to a website the attacker controls.

As an example, an attacker may post a message on www.example.com with the following link:

When another user clicks on this link, the browser executes the piece of code within the onclick attribute, thus replacing the string document.cookie with the list of cookies that are accessible from the current page. As a result, this list of cookies is sent to the attacker.com server. If the attacker's malicious posting is on an HTTPS website https://www.example.com, secure cookies will also be sent to attacker.com in plain text.

It is the responsibility of the website developers to filter out such malicious code.

Such attacks can be mitigated by using HttpOnly cookies. These cookies will not be accessible by client-side scripting languages like JavaScript, and therefore, the attacker will not be able to gather these cookies.

Cross-site scripting: proxy request

In older versions of many browsers, there were security holes in the implementation of the XMLHttpRequest API. This API allows to specify a proxy server that would get the reply, and this proxy server is not subject to the same origin policy. For example, a victim is reading an attacker's posting on www.example.com, and the attacker's script is executed in the victim's browser. The script generates a request to www.example.com with the proxy server attacker.com. Since the request is for www.example.com, all example.com cookies will be sent along with the request, but routed through the attacker's proxy server. Hence, the attacker would be able to harvest the victim's cookies.

This attack would not work with secure cookies, since they can only be transmitted over HTTPS connections, and the HTTPS protocol dictates end-to-end encryption (i.e. the information is encrypted on the user's browser and decrypted on the destination server). In this case, the proxy server would only see the raw, encrypted bytes of the HTTP request.

Cross-site request forgery

For example, Bob might be browsing a chat forum where another user, Mallory, has posted a message. Suppose that Mallory has crafted an HTML image element that references an action on Bob's bank's website (rather than an image file), e.g.,

If Bob's bank keeps his authentication information in a cookie, and if the cookie hasn't expired, then the attempt by Bob's browser to load the image will submit the withdrawal form with his cookie, thus authorizing a transaction without Bob's approval.


Cookie Jar Design Ideas | Natasha's Animations
src: st.depositphotos.com


Drawbacks of cookies

Besides privacy concerns, cookies also have some technical drawbacks. In particular, they do not always accurately identify users, they can be used for security attacks, and they are often at odds with the Representational State Transfer (REST) software architectural style.

Inaccurate identification

If more than one browser is used on a computer, each usually has a separate storage area for cookies. Hence cookies do not identify a person, but a combination of a user account, a computer, and a web browser. Thus, anyone who uses multiple accounts, computers, or browsers has multiple sets of cookies.

Likewise, cookies do not differentiate between multiple users who share the same user account, computer, and browser.

Inconsistent state on client and server

The use of cookies may generate an inconsistency between the state of the client and the state as stored in the cookie. If the user acquires a cookie and then clicks the "Back" button of the browser, the state on the browser is generally not the same as before that acquisition. As an example, if the shopping cart of an online shop is built using cookies, the content of the cart may not change when the user goes back in the browser's history: if the user presses a button to add an item in the shopping cart and then clicks on the "Back" button, the item remains in the shopping cart. This might not be the intention of the user, who possibly wanted to undo the addition of the item. This can lead to unreliability, confusion, and bugs. Web developers should therefore be aware of this issue and implement measures to handle such situations.


HTTP Cookie Hijacking in the Wild: Security and Privacy ...
src: i.ytimg.com


Alternatives to cookies

Some of the operations that can be done using cookies can also be done using other mechanisms.

JSON Web Tokens

A JSON Web Token (JWT) is a self-contained packet of information that can be used to store user identity and authenticity information. This allows them to be used in place of session cookies. Unlike cookies, which are automatically attached to each HTTP request by the browser, JWTs must be explicitly attached to each HTTP request by the web application.

HTTP authentication

The HTTP protocol includes the basic access authentication and the digest access authentication protocols, which allow access to a web page only when the user has provided the correct username and password. If the server requires such credentials for granting access to a web page, the browser requests them from the user and, once obtained, the browser stores and sends them in every subsequent page request. This information can be used to track the user.

IP address

Some users may be tracked based on the IP address of the computer requesting the page. The server knows the IP address of the computer running the browser (or the proxy, if any is used) and could theoretically link a user's session to this IP address.

However, IP addresses are generally not a reliable way to track a session or identify a user. Many computers designed to be used by a single user, such as office PCs or home PCs, are behind a network address translator (NAT). This means that several PCs will share a public IP address. Furthermore, some systems, such as Tor, are designed to retain Internet anonymity, rendering tracking by IP address impractical, impossible, or a security risk.

URL (query string)

A more precise technique is based on embedding information into URLs. The query string part of the URL is the part that is typically used for this purpose, but other parts can be used as well. The Java Servlet and PHP session mechanisms both use this method if cookies are not enabled.

This method consists of the web server appending query strings containing a unique session identifier to all the links inside of a web page. When the user follows a link, the browser sends the query string to the server, allowing the server to identify the user and maintain state.

These kinds of query strings are very similar to cookies in that both contain arbitrary pieces of information chosen by the server and both are sent back to the server on every request. However, there are some differences. Since a query string is part of a URL, if that URL is later reused, the same attached piece of information will be sent to the server, which could lead to confusion. For example, if the preferences of a user are encoded in the query string of a URL and the user sends this URL to another user by e-mail, those preferences will be used for that other user as well.

Moreover, if the same user accesses the same page multiple times from different sources, there is no guarantee that the same query string will be used each time. For example, if a user visits a page by coming from a page internal to the site the first time, and then visits the same page by coming from an external search engine the second time, the query strings would likely be different. If cookies were used in this situation, the cookies would be the same.

Other drawbacks of query strings are related to security. Storing data that identifies a session in a query string enables session fixation attacks, referer logging attacks and other security exploits. Transferring session identifiers as HTTP cookies is more secure.

Hidden form fields

Another form of session tracking is to use web forms with hidden fields. This technique is very similar to using URL query strings to hold the information and has many of the same advantages and drawbacks. In fact, if the form is handled with the HTTP GET method, then this technique is similar to using URL query strings, since the GET method adds the form fields to the URL as a query string. But most forms are handled with HTTP POST, which causes the form information, including the hidden fields, to be sent in the HTTP request body, which is neither part of the URL, nor of a cookie.

This approach presents two advantages from the point of view of the tracker. First, having the tracking information placed in the HTTP request body rather than in the URL means it will not be noticed by the average user. Second, the session information is not copied when the user copies the URL (to bookmark the page or send it via email, for example).

"window.name" DOM property

All current web browsers can store a fairly large amount of data (2-32 MB) via JavaScript using the DOM property window.name. This data can be used instead of session cookies and is also cross-domain. The technique can be coupled with JSON/JavaScript objects to store complex sets of session variables on the client side.

The downside is that every separate window or tab will initially have an empty window.name property when opened. Furthermore, the property can be used for tracking visitors across different websites, making it of concern for Internet privacy.

In some respects, this can be more secure than cookies due to the fact that its contents are not automatically sent to the server on every request like cookies are, so it is not vulnerable to network cookie sniffing attacks. However, if special measures are not taken to protect the data, it is vulnerable to other attacks because the data is available across different websites opened in the same window or tab.

Identifier for advertisers

Apple uses a tracking technique called "identifier for advertisers" (IDFA). This technique assigns a unique identifier to every user that buys an Apple iOS device (such as an iPhone or iPad). This identifier is then used by Apple's advertising network, iAd, to determine the ads that individuals are viewing and responding to.

ETag

Because ETags are cached by the browser, and returned with subsequent requests for the same resource, a tracking server can simply repeat any ETag received from the browser to ensure an assigned ETag persists indefinitely (in a similar way to persistent cookies). Additional caching headers can also enhance the preservation of ETag data.

ETags can be flushed in some browsers by clearing the browser cache.

Web storage

Some web browsers support persistence mechanisms which allow the page to store the information locally for later use.

The HTML5 standard (which most modern web browsers support to some extent) includes a JavaScript API called Web storage that allows two types of storage: local storage and session storage. Local storage behaves similarly to persistent cookies while session storage behaves similarly to session cookies, except that session storage is tied to an individual tab/window's lifetime (AKA a page session), not to a whole browser session like session cookies.

Internet Explorer supports persistent information in the browser's history, in the browser's favorites, in an XML store ("user data"), or directly within a web page saved to disk.

Some web browser plugins include persistence mechanisms as well. For example, Adobe Flash has Local shared object and Microsoft Silverlight has Isolated storage.

Browser cache

The browser cache can also be used to store information that can be used to track individual users. This technique takes advantage of the fact that the web browser will use resources stored within the cache instead of downloading them from the website when it determines that the cache already has the most up-to-date version of the resource.

For example, a website could serve a JavaScript file that contains code which sets a unique identifier for the user (for example, var userId = 3243242;). After the user's initial visit, every time the user accesses the page, this file will be loaded from the cache instead of downloaded from the server. Thus, its content will never change.

Browser fingerprint

A browser fingerprint is information collected about a browser's configuration, such as version number, screen resolution, and operating system, for the purpose of identification. Fingerprints can be used to fully or partially identify individual users or devices even when cookies are turned off.

Basic web browser configuration information has long been collected by web analytics services in an effort to accurately measure real human web traffic and discount various forms of click fraud. With the assistance of client-side scripting languages, collection of much more esoteric parameters is possible. Assimilation of such information into a single string comprises a device fingerprint. In 2010, EFF measured at least 18.1 bits of entropy possible from browser fingerprinting. Canvas fingerprinting, a more recent technique, claims to add another 5.7 bits.


Cookie Jar Design Ideas | Natasha's Animations
src: i0.wp.com


See also

  • Dynamic HTML
  • Enterprise JavaBeans
  • Session (computer science)
  • Secure cookies

MicroNugget: What are HTTP Cookies? - YouTube
src: i.ytimg.com


References

This article is based on material taken from the Free On-line Dictionary of Computing prior to 1 November 2008 and incorporated under the "relicensing" terms of the GFDL, version 1.3 or later.


asp.net mvc - Set-Cookie in Response Header not being created in ...
src: i.stack.imgur.com


External links

  • RFC 6265, the current official specification for HTTP cookies
  • HTTP cookies, Mozilla Developer Network
  • Using cookies via ECMAScript, Mozilla Developer Network
  • How Internet Cookies Work at HowStuffWorks
  • Cookies at the Electronic Privacy Information Center (EPIC)
  • Mozilla Knowledge-Base: Cookies
  • Cookie Domain, explain in detail how cookie domains are handled in current major browsers

Source of article : Wikipedia

Solar water heating

Solar Panel
src: www.jaikalkienergy.com

Solar water heating (SWH) is the conversion of sunlight into heat for water heating using a solar thermal collector. A variety of configurations are available at varying cost to provide solutions in different climates and latitudes. SWHs are widely used for residential and some industrial applications.

A sun-facing collector heats a working fluid that passes into a storage system for later use. SWH are active (pumped) and passive (convection-driven). They use water only, or both water and a working fluid. They are heated directly or via light-concentrating mirrors. They operate independently or as hybrids with electric or gas heaters. In large-scale installations, mirrors may concentrate sunlight onto a smaller collector.

The global solar thermal market is dominated by China, Europe, Japan and India, although Israel was one of the first countries to mandate installation of SWH in 1980, leading to a flourishing industry.


Video Solar water heating



History

Records of solar collectors in the U.S. date to before 1900, involving a black-painted tank mounted on a roof. In 1896 Clarence Kemp of Baltimore enclosed a tank in a wooden box, thus creating the first 'batch water heater' as they are known today. Frank Shuman built the world's first solar thermal power station in Maadi, Egypt, using parabolic troughs to power a 60-70 horsepower engine that pumped 6,000 gallons of water per minute from the Nile River to adjacent cotton fields.

Flat-plate collectors for solar water heating were used in Florida and Southern California in the 1920s. Interest grew in North America after 1960, but especially after the 1973 oil crisis.

See Appendix 1 for country-specific statistics on the "Use of solar water heating worldwide". Solar power is in use in Australia, Canada, China, Germany, India, Israel, Japan, Portugal, Romania, Spain, the United Kingdom and the United States.

Mediterranean

Israel, Cyprus and Greece are the per capita leaders in the use of solar water heating systems supporting 30%-40% of homes.

Flat plate solar systems were perfected and used on a large scale in Israel. In the 1950s a fuel shortage led the government to forbid heating water between 10 pm and 6 am. Levi Yissar built the first prototype Israeli solar water heater and in 1953 he launched the NerYah Company, Israel's first commercial manufacturer of solar water heating. Solar water heaters were used by 20% of the population by 1967. Following the energy crisis in the 1970s, in 1980 Israel required the installation of solar water heaters in all new homes (except high towers with insufficient roof area). As a result, Israel became the world leader in the use of solar energy per capita with 85% of households using solar thermal systems (3% of the primary national energy consumption), estimated to save the country 2 million barrels (320,000 m3) of oil a year.

In 2005, Spain became the world's first country to require the installation of photovoltaic electricity generation in new buildings, and the second (after Israel) to require the installation of solar water heating systems, in 2006.

Asia

After 1960 systems were marketed in Japan.

Australia has a variety of national and state and regulations for solar thermal starting with MRET in 1997.

Solar water heating systems are popular in China, where basic models start at around 1,500 yuan (US$235), around 80% less than in Western countries for a given collector size. At least 30 million Chinese households have one. The popularity is due to efficient evacuated tubes that allow the heaters to function even under gray skies and at temperatures well below freezing.

Latin America

Colombia developed a local solar water heating industry thanks to the designs of Las Gaviotas, directed by Paolo Lugari. Driven by a desire to reduce costs in social housing, the team studied the best systems from Israel and made adaptations to meet the specifications set by Banco Central Hipotecario (BCH) which required the system to operate in cities such as Bogotá that are overcast for more than 200 days annually. The ultimate designs were so successful that Las Gaviotas offered a 25-year warranty on its installations in 1984. Over 40,000 were installed and still function a quarter of a century later.


Maps Solar water heating



Design requirements

The type, complexity and size of a solar water heating system is mostly determined by:

  • Changes in ambient temperature and solar radiation between summer and winter
  • Changes in ambient temperature during the day-night cycle
  • Possibility of the potable water or collector fluid overheating or freezing

The minimum requirements of the system are typically determined by the amount or temperature of hot water required during winter, when a system's output and incoming water temperature are typically at their lowest. The maximum output of the system is determined by the need to prevent the water in the system from becoming too hot.

Freeze protection

Freeze protection measures prevent damage to the system due to the expansion of freezing transfer fluid. Drainback systems drain the transfer fluid from the system when the pump stops. Many indirect systems use antifreeze (e.g., propylene glycol) in the heat transfer fluid.

In some direct systems, collectors can be manually drained when freezing is expected. This approach is common in climates where freezing temperatures do not occur often, but is somewhat unreliable since it relies on an operator.

A third type of freeze protection is freeze-tolerance, where low pressure polymer water channels made of silicone rubber simply expand on freezing. One such collector now has European Solar Keymark accreditation.

Overheat protection

When no hot water has been used for a day or two, the fluid in the collectors and storage can reach high temperatures in all non-drainback systems. When the storage tank in a drainback system reaches its desired temperature, the pumps stop, ending the heating process and thus preventing the storage tank from overheating.

Some active systems deliberately cool the water in the storage tank by circulating hot water through the collector at times when there is little sunlight or at night, losing heat. This is most effective in direct or thermal store plumbing and is virtually ineffective in systems that use evacuated tube collectors, due to their superior insulation. Any collector type may still overheat. High pressure, sealed solar thermal systems ultimately rely on the operation of temperature and pressure relief valves. Low pressure, open vented heaters have simpler, more reliable safety controls, typically an open vent.


Heat Transfer Fluids for Solar Water Heating Systems | Department ...
src: energy.gov


Systems

Sample designs include a simple glass-topped insulated box with a flat solar absorber made of sheet metal, attached to copper heat exchanger pipes and dark-colored, or a set of metal tubes surrounded by an evacuated (near vacuum) glass cylinder. In industrial cases a parabolic mirror can concentrate sunlight on the tube. Heat is stored in a hot water storage tank. The volume of this tank needs to be larger with solar heating systems to compensate for bad weather and because the optimum final temperature for the solar collector is lower than a typical immersion or combustion heater. The heat transfer fluid (HTF) for the absorber may be water, but more commonly (at least in active systems) is a separate loop of fluid containing anti-freeze and a corrosion inhibitor delivers heat to the tank through a heat exchanger (commonly a coil of copper heat exchanger tubing within the tank). Copper is an important component in solar thermal heating and cooling systems because of its high heat conductivity, atmospheric and water corrosion resistance, sealing and joining by soldering and mechanical strength. Copper is used both in receivers and primary circuits (pipes and heat exchangers for water tanks).

Another lower-maintenance concept is the 'drain-back'. No anti-freeze is required; instead, all the piping is sloped to cause water to drain back to the tank. The tank is not pressurized and operates at atmospheric pressure. As soon as the pump shuts off, flow reverses and the pipes empty before freezing can occur.

Residential solar thermal installations fall into two groups: passive (sometimes called "compact") and active (sometimes called "pumped") systems. Both typically include an auxiliary energy source (electric heating element or connection to a gas or fuel oil central heating system) that is activated when the water in the tank falls below a minimum temperature setting, ensuring that hot water is always available. The combination of solar water heating and back-up heat from a wood stove chimney can enable a hot water system to work all year round in cooler climates, without the supplemental heat requirement of a solar water heating system being met with fossil fuels or electricity.

When a solar water heating and hot-water central heating system are used together, solar heat will either be concentrated in a pre-heating tank that feeds into the tank heated by the central heating, or the solar heat exchanger will replace the lower heating element and the upper element will remain to provide for supplemental heat. However, the primary need for central heating is at night and in winter when solar gain is lower. Therefore, solar water heating for washing and bathing is often a better application than central heating because supply and demand are better matched. In many climates, a solar hot water system can provide up to 85% of domestic hot water energy. This can include domestic non-electric concentrating solar thermal systems. In many northern European countries, combined hot water and space heating systems (solar combisystems) are used to provide 15 to 25% of home heating energy. When combined with storage, large scale solar heating can provide 50-97% of annual heat consumption for district heating.

Heat transfer

Direct

Direct or open loop systems circulate potable water through the collectors. They are relatively cheap. Drawbacks include:

  • They offer little or no overheat protection unless they have a heat export pump.
  • They offer little or no freeze protection, unless the collectors are freeze-tolerant.
  • Collectors accumulate scale in hard water areas, unless an ion-exchange softener is used.

The advent of freeze-tolerant designs expanded the market for SWH to colder climates. In freezing conditions, earlier models were damaged when the water turned to ice, rupturing one or more components.

Indirect

Indirect or closed loop systems use a heat exchanger to transfer heat from the "heat-transfer fluid" (HTF) fluid to the potable water. The most common HTF is an antifreeze/water mix that typically uses non-toxic propylene glycol. After heating in the panels, the HTF travels to the heat exchanger, where its heat is transferred to the potable water. Indirect systems offer freeze protection and typically overheat protection.

Propulsion

Passive

Passive systems rely on heat-driven convection or heat pipes to circulate the working fluid. Passive systems cost less and require low or no maintenance, but are less efficient. Overheating and freezing are major concerns.

Active

Active systems use one or more pumps to circulate water and/or heating fluid. This permits a much wider range of system configurations.

Pumped systems are more expensive to purchase and to operate. However, they operate at higher efficiency can be more easily controlled.

Active systems have controllers with features such as interaction with a backup electric or gas-driven water heater, calculation and logging of the energy saved, safety functions, remote access and informative displays.

Passive direct systems

An integrated collector storage (ICS or Batch Heater) system uses a tank that acts as both storage and collector. Batch heaters are thin rectilinear tanks with a glass side facing the sun at noon. They are simple and less costly than plate and tube collectors, but they may require bracing if installed on a roof (to support 400-700 lb (180-320 kg) lbs of water), suffer from significant heat loss at night since the side facing the sun is largely uninsulated and are only suitable in moderate climates.

A convection heat storage unit (CHS) system is similar to an ICS system, except the storage tank and collector are physically separated and transfer between the two is driven by convection. CHS systems typically use standard flat-plate type or evacuated tube collectors. The storage tank must be located above the collectors for convection to work properly. The main benefit of CHS systems over ICS systems is that heat loss is largely avoided since the storage tank can be fully insulated. Since the panels are located below the storage tank, heat loss does not cause convection, as the cold water stays at the lowest part of the system.

Active indirect systems

Pressurized antifreeze systems use a mix of antifreeze (almost always non-toxic propylene glycol) and water mix for HTF in order to prevent freeze damage.

Though effective at preventing freeze damage, antifreeze systems have drawbacks:

  • If the HTF gets too hot the glycol degrades into acid and then provides no freeze protection and begins to dissolve the solar loop's components.
  • Systems without drainback tanks must circulate the HTF - regardless of the temperature of the storage tank - to prevent the HTF from degrading. Excessive temperatures in the tank cause increased scale and sediment build-up, possible severe burns if a tempering valve is not installed, and if used for storage, possible thermostat failure.
  • The glycol/water HTF must be replaced every 3-8 years, depending on the temperatures it has experienced.
  • Some jurisdictions require more-expensive, double-walled heat exchangers even though propylene glycol is non-toxic.
  • Even though the HTF contains glycol to prevent freezing, it circulates hot water from the storage tank into the collectors at low temperatures (e.g. below 40 °F (4 °C)), causing substantial heat loss.

A drainback system is an active indirect system where the HTF (usually pure water) circulates through the collector, driven by a pump. The collector piping is not pressurized and includes an open drainback reservoir that is contained in conditioned or semi-conditioned space. The HTF remains in the drainback reseervoir unless the pump is operating and returns there (emptying the collector) when the pump is switched off. The collector system, including piping, must drain via gravity into the drainback tank. Drainback systems are not subject to freezing or overheating. The pump operates only when appropriate for heat collection, but not to protect the HTF, increasing efficiency and reducing pumping costs.

Do-it-yourself (DIY)

Plans for solar water heating systems are available on the Internet. DIY SWH systems are usually cheaper than commercial ones, and they are used both in the developed and developing world.

Comparison


Hertz Infratech Private Limited
src: hertzinfra.com


Components

Collector

Solar thermal collectors capture and retain heat from the sun and use it to heat a liquid. Two important physical principles govern the technology of solar thermal collectors:

  • Any hot object ultimately returns to thermal equilibrium with its environment, due to heat loss from conduction, convection and radiation. Efficiency (the proportion of heat energy retained for a predefined time period) is directly related to heat loss from the collector surface. Convection and radiation are the most important sources of heat loss. Thermal insulation is used to slow heat loss from a hot object. This follows the Second law of thermodynamics (the 'equilibrium effect').
  • Heat is lost more rapidly if the temperature difference between a hot object and its environment is larger. Heat loss is predominantly governed by the thermal gradient between the collector surface and the ambient temperatures. Conduction, convection and radiation all occur more rapidly over large thermal gradients (the delta-t effect).

Flat plate

Flat plate collectors are an extension of the idea to place a collector in an 'oven'-like box with glass directly facing the Sun. Most flat plate collectors have two horizontal pipes at the top and bottom, called headers, and many smaller vertical pipes connecting them, called risers. The risers are welded (or similarly connected) to thin absorber fins. Heat-transfer fluid (water or water/antifreeze mix) is pumped from the hot water storage tank or heat exchanger into the collectors' bottom header, and it travels up the risers, collecting heat from the absorber fins, and then exits the collector out of the top header. Serpentine flat plate collectors differ slightly from this "harp" design, and instead use a single pipe that travels up and down the collector. However, since they cannot be properly drained of water, serpentine flat plate collectors cannot be used in drainback systems.

The type of glass used in flat plate collectors is almost always low-iron, tempered glass. Such glass can withstand significant hail without breaking, which is one of the reasons that flat-plate collectors are considered the most durable collector type.

Unglazed or formed collectors are similar to flat-plate collectors, except they are not thermally insulated nor physically protected by a glass panel. Consequently, these types of collectors are much less efficient. For pool heating applications, the water to be heated is often colder than the ambient roof temperature, at which point the lack of thermal insulation allows additional heat to be drawn from the surrounding environment.

Evacuated tube

Evacuated tube collectors (ETC) are a way to reduce the heat loss, inherent in flat plates. Since heat loss due to convection cannot cross a vacuum, it forms an efficient isolation mechanism to keep heat inside the collector pipes. Since two flat glass sheets are generally not strong enough to withstand a vacuum, the vacuum is created between two concentric tubes. Typically, the water piping in an ETC is therefore surrounded by two concentric tubes of glass separated by a vacuum that admits heat from the sun (to heat the pipe) but that limits heat loss. The inner tube is coated with a thermal absorber. Vacuum life varies from collector to collector, from 5 years to 15 years.

Flat plate collectors are generally more efficient than ETC in full sunshine conditions. However, the energy output of flat plate collectors is reduced slightly more than ETCs in cloudy or extremely cold conditions. Most ETCs are made out of annealed glass, which is susceptible to hail, failing given roughly golf ball -sized particles. ETCs made from "coke glass," which has a green tint, are stronger and less likely to lose their vacuum, but efficiency is slightly reduced due to reduced transparency. ETCs can gather energy from the sun all day long at low angles due to their tubular shape.

Pump

PV pump

One way to power an active system is via a photovoltaic (PV) panel. To ensure proper pump performance and longevity, the (DC) pump and PV panel must be suitably matched. Although a PV-powered pump does not operate at night, the controller must ensure that the pump does not operate when the sun is out but the collector water is not hot enough.

PV pumps offer the following advantages:

  • Simpler/cheaper installation and maintenance
  • Excess PV output can be used for household electricity use or put back into the grid.
  • Can dehumidify living space.
  • Can operate during a power outage.
  • Avoids the carbon consumption from using grid-powered pumps.

Bubble pump

A bubble pump (also known as geyser pump) is suitable for flat panel as well as vacuum tube systems. In a bubble pump system, the closed HTF circuit is under reduced pressure, which causes the liquid to boil at low temperature as the sun heats it. The steam bubbles form a geyser, causing an upward flow. The bubbles are separated from the hot fluid and condensed at the highest point in the circuit, after which the fluid flows downward toward the heat exchanger caused by the difference in fluid levels. The HTF typically arrives at the heat exchanger at 70 °C and returns to the circulating pump at 50 °C. Pumping typically starts at about 50 °C and increases as the sun rises until equilibrium is reached.

Controller

A differential controller senses temperature differences between water leaving the solar collector and the water in the storage tank near the heat exchanger. The controller starts the pump when the water in the collector is sufficiently about 8-10 °C warmer than the water in the tank, and stops it when the temperature difference reaches 3-5 °C. This ensures that stored water always gains heat when the pump operates and prevents the pump from excessive cycling on and off. (In direct systems the pump can be triggered with a difference around 4 °C because they have no heat exchanger.)

Tank

The simplest collector is a water-filled metal tank in a sunny place. The sun heats the tank. This was how the first systems worked. This setup would be inefficient due to the equilibrium effect: as soon as heating of the tank and water begins, the heat gained is lost to the environment and this continues until the water in the tank reaches ambient temperature. The challenge is to limit the heat loss.

  • The storage tank can be situated lower than the collectors, allowing increased freedom in system design and allowing pre-existing storage tanks to be used.
  • The storage tank can be hidden from view.
  • The storage tank can be placed in conditioned or semi-conditioned space, reducing heat loss.
  • Drainback tanks can be used.

Insulated tank

ICS or batch collectors reduce heat loss by thermally insulating the tank. This is achieved by encasing the tank in a glass-topped box that allows heat from the sun to reach the water tank. The other walls of the box are thermally insulated, reducing convection and radiation. The box can also have a reflective surface on the inside. This reflects heat lost from the tank back towards the tank. In a simple way one could consider an ICS solar water heater as a water tank that has been enclosed in a type of 'oven' that retains heat from the sun as well as heat of the water in the tank. Using a box does not eliminate heat loss from the tank to the environment, but it largely reduces this loss.

Standard ICS collectors have a characteristic that strongly limits the efficiency of the collector: a small surface-to-volume ratio. Since the amount of heat that a tank can absorb from the sun is largely dependent on the surface of the tank directly exposed to the sun, it follows that the surface size defines the degree to which the water can be heated by the sun. Cylindrical objects such as the tank in an ICS collector have an inherently small surface-to-volume ratio. Collectors attempt to increase this ratio for efficient warming of the water. Variations on this basic design include collectors that combine smaller water containers and evacuated glass tube technology, a type of ICS system known as an Evacuated Tube Batch (ETB) collector.


Solar Water Heating System â€
src: lifetheexperience.files.wordpress.com


Applications

Evacuated tube

ETSCs can be more useful than other solar collectors during winter season. ETCs can be used for heating and cooling purposes in industries like pharmaceutical and drug, paper, leather and textile and also for residential houses, hospitals nursing home, hotels swimming pool etc.

An ETC can operate at a range of temperatures from medium to high for solar hot water, swimming pool, air conditioning and solar cooker.

ETCs higher temperature (up to 200 °C (392 °F)) making them suitable for industrial applications such as steam generation, heat engine and solar drying.

Swimming pools

Floating pool covering systems and separate STCs are used for pool heating.

Pool covering systems, whether solid sheets or floating disks, act as insulation and reduce heat loss. Much heat loss occurs through evaporation, and using a cover slows evaporation.

STCs for nonpotable pool water use are often made of plastic. Pool water is mildly corrosive due to chlorine. Water is circulated through the panels using the existing pool filter or supplemental pump. In mild environments, unglazed plastic collectors are more efficient as a direct system. In cold or windy environments evacuated tubes or flat plates in an indirect configuration are used in conjunction with a heat exchanger. This reduces corrosion. A fairly simple differential temperature controller is used to direct the water to the panels or heat exchanger either by turning a valve or operating the pump. Once the pool water has reached the required temperature, a diverter valve is used to return water directly to the pool without heating. Many systems are configured as drainback systems where the water drains into the pool when the water pump is switched off.

The collector panels are usually mounted on a nearby roof, or ground-mounted on a tilted rack. Due to the low temperature difference between the air and the water, the panels are often formed collectors or unglazed flat plate collectors. A simple rule-of-thumb for the required panel area needed is 50% of the pool's surface area. This is for areas where pools are used in the summer season only. Adding solar collectors to a conventional outdoor pool, in a cold climate, can typically extend the pool's comfortable usage by months and more if an insulating pool cover is used. An active solar energy system analysis program may be used to optimize the solar pool heating system before it is built.


DIY Solar Thermal Water Heater! - COPPER PIPE Solar Water Heater ...
src: i.ytimg.com


Energy production

The amount of heat delivered by a solar water heating system depends primarily on the amount of heat delivered by the sun at a particular place (insolation). In the tropics insolation can be relatively high, e.g. 7 kWh/m2 per day, versus e.g., 3.2 kWh/m2 per day in temperate areas. Even at the same latitude average insolation can vary a great deal from location to location due to differences in local weather patterns and the amount of overcast. Calculators are available for estimating insolation at a site.

Below is a table that gives a rough indication of the specifications and energy that could be expected from a solar water heating system involving some 2 m2 of absorber area of the collector, demonstrating two evacuated tube and three flat plate solar water heating systems. Certification information or figures calculated from those data are used. The bottom two rows give estimates for daily energy production (kWh/day) for a tropical and a temperate scenario. These estimates are for heating water to 50 °C above ambient temperature.

With most solar water heating systems, the energy output scales linearly with the collector surface area.

The figures are fairly similar between the above collectors, yielding some 4 kWh/day in a temperate climate and some 8 kWh/day in a tropical climate when using a collector with a 2 m2 absorber. In the temperate scenario this is sufficient to heat 200 litres of water by some 17 °C. In the tropical scenario the equivalent heating would be by some 33 °C. Many thermosiphon systems have comparable energy output to equivalent active systems. The efficiency of evacuated tube collectors is somewhat lower than for flat plate collectors because the absorbers are narrower than the tubes and the tubes have space between them, resulting in a significantly larger percentage of inactive overall collector area. Some methods of comparison calculate the efficiency of evacuated tube collectors based on the actual absorber area and not on the 'space occupied as has been done in the above table. Efficiency is reduced at higher temperatures.


WEATER HEATER
src: www.durgasolar.org


Costs

In sunny, warm locations, where freeze protection is not necessary, an ICS (batch type) solar water heater can be cost effective. In higher latitudes, design requirements for cold weather add to system complexity and cost. This increases initial costs, but not life-cycle costs. The biggest single consideration is therefore the large initial financial outlay of solar water heating systems. Offsetting this expense can take years. The payback period is longer in temperate environments. Since solar energy is free, operating costs are small. At higher latitudes, solar heaters may be less effective due to lower insolation, possibly requiring larger and/or dual-heating systems. In some countries government incentives can be significant.

Cost factors (positive and negative) include:

  • Price of solar water heater (more complex systems are more expensive)
  • Efficiency
  • Installation cost
  • Electricity used for pumping
  • Price of water heating fuel (e.g. gas or electricity) saved per kWh
  • Amount of water heating fuel used
  • Initial and/or recurring government subsidy
  • Maintenance cost (e.g. antifreeze or pump replacements)
  • Savings in maintenance of conventional (electric/gas/oil) water heating system

Payback times can vary greatly due to regional sun, extra cost due to frost protection needs of collectors, household hot water use etc. For instance in central and southern Florida the payback period could easily be 7 years or less rather than the 12.6 years indicated on the chart for the U.S.

The payback period is shorter given greater insolation. However, even in temperate areas, solar water heating is cost effective. The payback period for photovoltaic systems has historically been much longer. Costs and payback period are shorter if no complementary/backup system is required. thus extending the payback period of such a system.

Subsidies

Australia operates a system of Renewable Energy Credits, based on national renewable energy targets.

The Toronto Solar Neighbourhoods Initiative offers subsidies for the purchase of solar water heating units.


DIY Solar Water Heater! - Solar Thermal COPPER COIL Water Heater ...
src: i.ytimg.com


Energy footprint and life cycle assessment

Energy footprint

The source of electricity in an active SWH system determines the extent to which a system contributes to atmospheric carbon during operation. Active solar thermal systems that use mains electricity to pump the fluid through the panels are called 'low carbon solar'. In most systems the pumping reduces the energy savings by about 8% and the carbon savings of the solar by about 20%. However, low power pumps operate with 1-20W. Assuming a solar collector panel delivering 4 kWh/day and a pump running intermittently from mains electricity for a total of 6 hours during a 12-hour sunny day, the potentially negative effect of such a pump can be reduced to about 3% of the heat produced.

However, PV-powered active solar thermal systems typically use a 5-30 W PV panel and a small, low power diaphragm pump or centrifugal pump to circulate the water. This reduces the operational carbon and energy footprint.

Alternative non-electrical pumping systems may employ thermal expansion and phase changes of liquids and gases.

Life Cycle Energy Assessment

Recognised standards can be used to deliver robust and quantitative life cycle assessments (LCA). LCA considers the financial and environmental costs of acquisition of raw materials, manufacturing, transport, using, servicing and disposal of the equipment. Elements include:

  • Financial costs and gains
  • Energy consumption
  • CO2 and other emissions

In terms of energy consumption, some 60% goes into the tank, with 30% towards the collector (thermosiphon flat plate in this case). In Italy, some 11 giga-joules of electricity are used in producing SWH equipment, with about 35% goes toward the tank, with another 35% towards the collector. The main energy-related impact is emissions. The energy used in manufacturing is recovered within the first 2-3 years of use (in southern Europe).

By contrast the energy payback time in the UK is reported as only 2 years. This figure was for a direct system, retrofitted to an existing water store, PV pumped, freeze tolerant and of 2.8 sqm aperture. For comparison, a PV installation took around 5 years to reach energy payback, according to the same comparative study.

In terms of CO2 emissions, a large fraction of the emissions saved is dependent on the degree to which gas or electricity is used to supplement the sun. Using the Eco-indicator 99 points system as a yardstick (i.e. the yearly environmental load of an average European inhabitant) in Greece, a purely gas-driven system may have fewer emissions than a solar system. This calculation assumes that the solar system produces about half of the hot water requirements of a household.

A test system in Italy produced about 700 kg of CO2, considering all the components of manufacture, use and disposal. Maintenance was identified as an emissions-costly activity when the heat transfer fluid (glycol-based) was replaced. However, the emissions cost was recovered within about two years of use of the equipment.

In Australia, life cycle emissions were also recovered. The tested SWH system had about 20% of the impact of an electrical water heater and half that of a gas water heater.

Analysing their lower impact retrofit freeze-tolerant solar water heating system, Allen et al. (qv) reported a production CO2 impact of 337 kg, which is around half the environmental impact reported in the Ardente et al. (qv) study.


Solar Water Heater | eBay
src: i.ebayimg.com


System specification and installation

  • Most SWH installations require backup heating.
  • The amount of hot water consumed each day must be replaced and heated. In a solar-only system, consuming a high fraction of the water in the reservoir implies significant reservoir temperature variations. The larger the reservoir the smaller the daily temperature variation.
  • SWH systems offer significant scale economies in collector and tank costs. Thus the most economically efficient scale meets 100% of the heating needs of the application.
  • Direct systems (and some indirect systems using heat exchangers) can be retrofitted to existing stores.
  • Equipment components must be insulated to achieve full system benefits. The installation of efficient insulation significantly reduces heat loss.
  • The most efficient PV pumps start slowly in low light levels, so they may cause a small amount of unwanted circulation while the collector is cold. The controller must prevent stored hot water from this cooling effect.
  • Evacuated tube collector arrays can be adjusted by removing/adding tubes or their heat pipes, allowing customization during/after installation.
  • Above 45 degrees latitude, roof mounted sun-facing collectors tend to outproduce wall-mounted collectors. However, arrays of wall-mounted steep collectors can sometimes produce more useful energy because gains in used energy in winter can offset the loss of unused (excess) energy in summer.

Financial Benefits of Solar Water Heating | Solar Energy
src: www.glesolar.com


Standards

Europe

  • EN 806: Specifications for installations inside buildings conveying water for human consumption. General.
  • EN 1717: Protection against pollution of potable water in water installations and general requerements of devices to prevent pollution by backflow.
  • EN 60335: Specification for safety of household and similar electrical appliances. (2-21)
  • UNE 94002:2005 Thermal solar systems for domestic hot water production. Calculation method for heat demand.

United States

  • OG-300: OG-300 Certification of Solar Water Heating Systems.

Canada

  • CAN/CSA-F378 Series 11 (Solar collectors)
  • CAN/CSA-F379 Series 09 (Packaged solar domestic hot water systems)
  • SRCC Standard 600 (Minimum standard for solar thermal concentrating collectors)

Australia

  • Renewable Energy (Electricity) Act 2000
  • Renewable Energy (Electricity) (Large-scale Generation Shortfall Charge) Act 2000
  • Renewable Energy (Electricity) (Small-scale Technology Shortfall Charge) Act 2010
  • Renewable Energy (Electricity) Regulations 2001
  • Renewable Energy (Electricity) Regulations 2001 - STC Calculation Methodology for Solar Water Heaters and Air Source Heat Pump Water Heaters
  • Renewable Energy (Electricity) Amendment (Transitional Provision) Regulations 2010
  • Renewable Energy (Electricity) Amendment (Transitional Provisions) Regulations 2009

All relevant participants of the Large-scale Renewable Energy Target and Small-scale Renewable Energy Scheme must comply with the above Acts.


Instalación Solar heating: Solar water heater
src: www.sunandclimate.com


Worldwide use

Europe


Should you buy solar water heater
src: waterheatertimer.org


See also

  • Australia: Solar hot water in Australia
  • Solar thermal collector
  • Solar air heating
  • Solar air conditioning
  • Concentrating solar power
  • Passive solar
  • Renewable heat
  • Solar combisystem
  • Solar energy
  • Solar thermal energy
  • Renewable energy commercialization
  • Sustainable design

Solar Thermal is Dead | GreenBuildingAdvisor.com
src: www.greenbuildingadvisor.com


References


Solar Water Heating and Cooking
src: electricitybook.com


External links

  • Parts of a solar heating system

Source of article : Wikipedia