Revision 63:dea79565e317 src/pithos/content/login/pithos-login.html

b/src/pithos/content/login/pithos-login.html
11 11

  
12 12
<body>
13 13
	<script type="application/x-javascript">
14
	function hasCookie() {
15
		return moz.hasCookieByHostAndName('.pithos.grnet.gr', '_gss_a');
14
	function hasNonEmptyCookie() {
15
    var cookie = moz.findCookieByHostAndName('.pithos.grnet.gr', '_gss_a')
16
    var exists = cookie != undefined
17
    var nonEmpty = exists && cookie.value != undefined && cookie.value != ''
18
//    alert('exists = ' + exists + ', nonEmpty = ' + nonEmpty)
19

  
20
    return nonEmpty
16 21
	}
17 22

  
18 23
	function checkAndReplace() {
19
		if( hasCookie() ) {
24
		if( hasNonEmptyCookie() ) {
20 25
			window.location.replace('chrome://pithos/content/pithos.xul');
21 26
			return true;
22 27
		}

Also available in: Unified diff