Gossamer Forum
Home : Products : Gossamer Links : Discussions :

read cookies

Quote Reply
read cookies
If I have cookie that write like this in PHP
<?php setcookie("user", $_GET["ID"], time()+360000);?>

How can I know the ID of the cookie using GL
Quote Reply
Re: [nir] read cookies In reply to
Hi,

You can use my ULTRAGlobals function I would imagine:

Code:
<%Plugins::ULTRAGlobals::Load_Cookie('user')%>
That should do it :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] read cookies In reply to
Thanks Andy
Quote Reply
Re: [Andy] read cookies In reply to
Andy I have small question-
<?php setcookie("user", $_GET["ID"], time()+360000);?>


Can I do it with global, to send the ID as a value and that it will create the cookie something like <%makecookie("ID")%>

Last edited by:

nir: Aug 12, 2008, 2:30 AM
Quote Reply
Re: [nir] read cookies In reply to
Hi,

So you want to set a cookie, called "user", with the value passed in (i.e "Test") , and set an expiration date? (100 hours by the looks of your code?)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] read cookies In reply to
Yes:) but one month time.
Quote Reply
Re: [nir] read cookies In reply to
Hi,

Where exactly are you wanting to set this cookie?

The problem is - if using a global in page.cgi (either as page.cgi?xxx , or mod_rewrite), then the print $IN->header() has already been printed out - so you can't actually set a cookie after that.

The only way I can think of (depending on which area you are trying to run this cookie setting code), is via a PRE hook ..

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] read cookies In reply to

It's more line www.site.com/SID=2
I need to takes the SID and create the cookie with is vlaue

Quote Reply
Re: [nir] read cookies In reply to
Hi,

So is this for people referring to your site? i.e you wanna track the ID number of the person refering to your site?

Are you running your site statically, or dynamically?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] read cookies In reply to
dynamically
Quote Reply
Re: [nir] read cookies In reply to
Hi,

You could try this plugin I just wrote.

It will set a cookie called "user", IF they refer people to any of these URLs:

/page.cgi?ID=12324
/page.cgi?d=1;ID=1234

I tried it on my site with the first URL - and it sets the cookie just fine.

Hopefully that works for you =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!