CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Can't set Cookie through SSI

 



liox0001
Deleted

Nov 12, 2000, 7:54 AM

Post #1 of 4 (322 views)
Can't set Cookie through SSI Can't Post

Okay, my problem is my SetCookie script would send a cookie if I access the script directly. But it doesn't work when I called it through SSI.

I searched the net for hours for an answer... I been only able to find people asking the same quesiton, but no answer!

Please help! Thanks in advance!


sleuth
Enthusiast / Moderator

Nov 12, 2000, 11:07 AM

Post #2 of 4 (322 views)
Re: Can't set Cookie through SSI [In reply to] Can't Post

 
I've not tried that before because I usually use an <iframe, have you tried that?

<iframe src="http://www.site.com/cgi-bin/cookie.cgi" width=1 height=1 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no></iframe>

I do that to set cookies on html pages, Inline Frames are good to use because it actually takes the browser to the script as if you typed in the address in the address bar.

Sleuth


liox0001
Deleted

Nov 12, 2000, 4:48 PM

Post #3 of 4 (322 views)
Re: Can't set Cookie through SSI [In reply to] Can't Post

Thanks for the <iframe> tips. I tired using the <img> tag (<img src=cookie.cgi> ) to access the cookie script.

the <img> and <iframe> method, if the script would only set a cookie. however, my script also log the access stat. by using the two method mentioned, it would not log the information correctly...

anyway, i guess i have to splite my script into two different ones... one to set cookie and the other to log the stat.

thanks.


Jasmine
Administrator

Nov 23, 2000, 8:55 AM

Post #4 of 4 (322 views)
Re: Can't set Cookie through SSI [In reply to] Can't Post

The reason the cookie doesn't work when using ssi is that the cookie needs to be set before any headers are sent to the browser. The headers have already been received and parsed by the browser at the time the html page is fetched, but before the ssi is invoked.

The only way that I'm aware of to set cookies after the headers have been sent is to use javascript cookies.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives