GetDotted Domains

Viewing Thread:
"setcookie.. whats wrong with this?"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Fri 02/08/02 at 01:50
Regular
Posts: 787
Hey i'm having problems with my code:

setcookie("username", "$inputuser",time()+600,"/","",0);

it works fine when hosted on my computer but dosnt seem to set on freeola. I was told to change it to

setcookie("username", "$inputuser",time()+600,"/","www.gameslab.co.uk",0);

but still no joy
Tue 20/08/02 at 19:48
Posts: 0
Where are you setting the cookie in your code? If you are doing it server side you need to make sure that it is sent with the header and no content has been sent yet. If you are using PHP to set the cookie I would sugest putting:

ob_start() at the top of the script and then flushing the buffer with ob_end_flush() just after you have set the cookie.
Wed 14/08/02 at 15:45
Posts: 84
This Javascript function may help


// *** A function to store a value in a cookie (MS-14.9.01) ***

function setCookieValue(cookieName,cookieValue,lifeSpanDays)
{
// Declare and initialise variables

expiryDate = new Date
expiryDate.setDate(expiryDate.getDate()+lifeSpanDays)

// Save data to cookie

document.cookie = cookieName + "=" + cookieValue + "; expires=" + expiryDate.toGMTString();
}
Wed 14/08/02 at 15:43
Posts: 84
Are you trying to set a cookie on the server? What effect are you trying to achieve?
Fri 02/08/02 at 15:51
Regular
"Eff, you see, kay?"
Posts: 14,156
Try $SERVER_NAME instead of www.gameslab.co.uk - and remember that cookies only appears after you reload the page, not immediately...
Fri 02/08/02 at 01:50
Posts: 0
Hey i'm having problems with my code:

setcookie("username", "$inputuser",time()+600,"/","",0);

it works fine when hosted on my computer but dosnt seem to set on freeola. I was told to change it to

setcookie("username", "$inputuser",time()+600,"/","www.gameslab.co.uk",0);

but still no joy

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Great services and friendly support
I have been a subscriber to your service for more than 9 yrs. I have got at least 12 other people to sign up to Freeola. This is due to the great services offered and the responsive friendly support.
Impressive control panel
I have to say that I'm impressed with the features available having logged on... Loads of info - excellent.
Phil

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.