Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Global to check if cookies are enable ?

Quote Reply
Global to check if cookies are enable ?
Hi,

Is it possible to create a global that checks if the cookies are enable in the browser of the visitors? If so, thank you for helping me to create it.

Thank you.

François
Quote Reply
Re: [Franco] Global to check if cookies are enable ? In reply to
There isn't any way a global can check to see if cookies _could_ be accepted, but you can check to see if the user is currently using any cookies on the site (which means they are capable of accepting them and they haven't been disabled) with:

Code:
sub { scalar $IN->cookie }

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Global to check if cookies are enable ? In reply to
Thank you, Jason.

I finally found a way to do this with a javascript:

Code:
<SCRIPT LANGUAGE="javascript">
cookiestring = "test=1;"
document.cookie = cookiestring;
if (document.cookie) {
cookiestring = "test=1;"
document.cookie = cookiestring;
document.write ("something.....");
}
</SCRIPT>


That works fine for me.

Thank you again! Smile

François