1
Eluzion
Two questions - cookies and xoops version
  • 2006/11/6 16:36

  • Eluzion

  • Just popping in

  • Posts: 44

  • Since: 2005/2/14


Hey everyone,

I have two quick questions:

1) XOOPS obviously uses cookies but by default, they're being rejected by the web browser. Is there any way to make your website "legit" so the cookies are accepted by default? That would be much easier than having to explain to everyone that uses the website how to enable cookies for that website. ;) I did some searching on it and it seems you need a P3P Policy or something, but all the generator/creating software for that costs money. Anything really basic and free out there?

2) Second and probably a stupid question -- how do you check what XOOPS version your website is running?

Thanks!

2
m0nty
Re: Two questions - cookies and xoops version
  • 2006/11/6 16:47

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


no.. your site is legit.. there's noone who can say different..

cookies being blocked or http headers is 100% on the users responsibility for making sure they setup their browsers/firewalls correctly so that they can view/access the sites they want to.

if they don't want to accept cookies or they will not unblock headers then, they have no grounds to complain.. why should you reduce the security of your website for those that can't read the manual for their own software that they use. it physically states on browsers and firewalls the implications of blocking cookies and that some sites may not work.

2. goto admin and look in the footer..

or check includes/version.php

3
m0nty
Re: Two questions - cookies and xoops version
  • 2006/11/6 17:02

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


you can get a p3p policy editor here

also you can add a little script to the head tag & body of your theme.html

<script language="JavaScript">
<!--

/*
WM_setCookie(), WM_readCookie(), WM_killCookie()
A set of functions that eases the pain of using cookies.

Source: Webmonkey Code Library
(http://www.hotwired.com/webmonkey/javascript/code_library/)

Author: Nadav Savio
Author Email: nadav@wired.com
*/


// This next little bit of code tests whether the user accepts cookies.
var WM_acceptsCookies false;
if(
document.cookie == '') {
    
document.cookie 'WM_acceptsCookies=yes'// Try to set a cookie.
    
if(document.cookie.indexOf('WM_acceptsCookies=yes') != -1) {
    
WM_acceptsCookies true
    }
// If it succeeds, set variable
} else { // there was already a cookie
  
WM_acceptsCookies true;
}


function 
WM_setCookie (namevaluehourspathdomainsecure) {
    if (
WM_acceptsCookies) { // Don't waste your time if the browser doesn't accept cookies.
    
var not_NN2 = (navigator && navigator.appName 
               
&& (navigator.appName == 'Netscape'
               && 
navigator.appVersion 
               
&& (parseInt(navigator.appVersion) == 2))?false:true;

    if(
hours && not_NN2) { // NN2 cannot handle Dates, so skip this part
        
if ( (typeof(hours) == 'string') && Date.parse(hours) ) { // already a Date string
        
var numHours hours;
        } else if (
typeof(hours) == 'number') { // calculate Date from number of hours
        
var numHours = (new Date((new Date()).getTime() + hours*3600000)).toGMTString();
        }
    }
    
document.cookie name '=' escape(value) + ((numHours)?(';expires=' numHours):'') + ((path)?';path=' path:'') + ((domain)?';domain=' domain:'') + ((secure && (secure == true))?'; secure':''); // Set the cookie, adding any parameters that were specified.
    
}
// WM_setCookie


function WM_readCookie(name) {
    if(
document.cookie == '') { // there's no cookie, so go no further
    
return false
    } else { 
// there is a cookie
    
var firstCharlastChar;
    var 
theBigCookie document.cookie;
    
firstChar theBigCookie.indexOf(name);    // find the start of 'name'
    
var NN2Hack firstChar name.length;
    if((
firstChar != -1) && (theBigCookie.charAt(NN2Hack) == '=')) { // if you found the cookie
        
firstChar += name.length 1// skip 'name' and '='
        
lastChar theBigCookie.indexOf(';'firstChar); // Find the end of the value string (i.e. the next ';').
        
if(lastChar == -1lastChar theBigCookie.length;
        return 
unescape(theBigCookie.substring(firstCharlastChar));
    } else { 
// If there was no cookie of that name, return false.
        
return false;
    }
    }    
// WM_readCookie

function WM_killCookie(namepathdomain) {
  var 
theValue WM_readCookie(name); // We need the value to kill the cookie
  
if(theValue) {
      
document.cookie name '=' theValue '; expires=Fri, 13-Apr-1970 00:00:00 GMT' + ((path)?';path=' path:'') + ((domain)?';domain=' domain:''); // set an already-expired cookie
  
}
// WM_killCookie


// -->

</script>


then in the <body> tag you add

<script>
if (!
WM_acceptsCookies)
{
  
document.write("<p>your browser does NOT accept cookies, this website requires cookies to be enabled.</p>");
}
</
script>


you could also add a http link in the document.write above with instructions for enabling cookies.

4
Eluzion
Re: Two questions - cookies and xoops version
  • 2006/11/6 20:10

  • Eluzion

  • Just popping in

  • Posts: 44

  • Since: 2005/2/14


Hey m0nty, thanks for the reply!

So if I do get the P3P policy setup, then the cookies won't be considered 3rd party and will automatically be accepted by the browser?

While I understand the user can accept cookies from any website he or she wishes, I just don't understand why some websites (example: facebook.com, myspace.com, etc.) will never have their coookies blocked by IE (perhaps they're on a master list of websites that are deemed "legit"? hehe).

Anyways, about checking the version - when I check the version.php file it's blank. Inside my administration panel/page, the bottom of the page simply has a Copyright 2006. Would the system version under modules be my XOOPS version?

Thanks again.

5
RachelVirago
Re: Two questions - cookies and xoops version

It seems to me everytime IE is updated we have another round of cookie problems, the user who is often unsophisticated by default (sic) blames the site.

Other major problem causer is ISP software suites such as NTL or AOL For Example

Or This problem

A get Firefox button can help some but ironically the less savy user tends only to trust IE and microsoft, annoying.

My online bank are very exited about latest IE upgrade and have promised lots of "new functionality" from this "exciting new browser" soon. So I may be forced to use it for online banking soon (or change my bank) lol.
Being transgender is NOT a choice.

Login

Who's Online

137 user(s) are online (107 user(s) are browsing Support Forums)


Members: 0


Guests: 137


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits