Set Cookie: ???

W

WA Support

Hello,

I am fairly new to programming in C, so please excuse my ignorance
here.

I am working on a Redhat 7.3 system with Apache 1.3.27 from the Redhat
distribution running. I am trying to write a routine that uses cgi
for a user to login to a website and then set a session cookie with
the username as the value of the cookie.

I have looked at CGIC (Boutell) and the CGI Library (Carson Harding),
to see how they set cookies in a browser, but they don't work in my
system. CGI Library works for Internet Explorer, but not Netscape.
CGIC doesn't work for either.

Both CGIC and CGI Library use the Set-Cookie: command, but I can not
get it to work.

I have also looked at CGI-LIB Library (Noel Aguilar), but these
routines are primarily for reading environment variables as far as I
can tell.

Could someone please give me a basic example of how to use the
Set-Cookie command, or show me another way to set cookies in a
browser, and then describe a way that I can go back and read the
cookie information back out of a client browser?

Thanks,
Murrah Boswell
 
M

Mike Wahler

WA Support said:
Hello,

I am fairly new to programming in C, so please excuse my ignorance
here.

I am working on a Redhat 7.3 system with Apache 1.3.27 from the Redhat
distribution running. I am trying to write a routine that uses cgi
for a user to login to a website and then set a session cookie with
the username as the value of the cookie.

1. Please learn Usenet etiquette. See www.usenet.org

This will tell you :

a) read a group's FAQ or 'welcome message' before posting.
The welcome message for comp.lang.c is:
http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html

b) if you want to post the same message to more than
one group, cross-post, don't post separate messages
to each group.

c) that your question is just as off-topic here as in
the other group I saw it (alt.comp.lang.learn.c-c++)

-Mike
 
E

E. Robert Tisdale

Mike said:
1. Please

Polite! That's good.
learn Usenet etiquette. See www.usenet.org

This will tell you :

a) read a group's FAQ or 'welcome message' before posting.
The welcome message for comp.lang.c is:
http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html

b) if you want to post the same message to more than
one group, cross-post, don't post separate messages
to each group.

c) that your question is just as off-topic here as in
the other group I saw it (alt.comp.lang.learn.c-c++)

This admonition probably wasn't helpful.
You didn't even redirect the question to a more appropriate forum.
It would probably have been better not to respond at all.
 
C

clord

Listen, your off topic, but while you are, do you know anybody selling a
good cheap toaster? I'm in need.

E-mail me if you've got any leads: (e-mail address removed)

Thanks guys,
CLord.
 
W

WA Support

Excuse me, but how is it off topic in a C language group to ask a C
programming question?

Also, do you know that answer to my original question?

Murrah Boswell
 
M

Mike Wahler

WA Support said:
Excuse me, but how is it off topic in a C language group to ask a C
programming question?

Yours was not a C question, it was a question about
browsers and cookies. C has no knowledge of or
support for such. As I've already asked, please
see:
http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html
before posting here again.


Also, do you know that answer to my original question?

Anyone that does should not respond here.
We only discuss (ISO standard) C here.

To both you and 'CLord': Please don't top post.
Thank you.

-Mike
 
W

WA Support

Okay, I read the 'welcome message' and read
http://www.albion.com/netiquette/corerules.html, but I still don't
understand why you guys think that I am off topic?

I have asked a perfectly legitimate C question about writing CGI
scripts, and then in those scripts, how to set cookies in a client
browser through Apache.

What of this is off topic?

Murrah Boswell
 
A

Arthur J. O'Dwyer

Okay, I read the 'welcome message' and read
http://www.albion.com/netiquette/corerules.html, but I still don't
understand why you guys think that I am off topic?

I have asked a perfectly legitimate C question about writing CGI
scripts, and then in those scripts, how to set cookies in a client
browser through Apache.

What of this is off topic?

The "CGI" part. The "cookies" part. The "browser" part. The "Apache"
part. And, of course, the top-posting part. Please put your response
*below* the text to which you are responding.

A: Because if everything were written that way, it
would be hard to read.

Q: Why does everyone always say not to top-post?


If you have a question about the C language, or about the C standard,
or about the topicality of this newsgroup in particular; *and* your
question is not already covered by the FAQ; then by all means, go ahead
and ask it here. We'll try to help.

For your original question, you might try plugging the keywords
"CGI", "Apache" "SetCookie" into the search box at www.google.com
and seeing what comes back. Sorry we can't be of more help here.

-Arthur
 
D

Default User

WA said:
Excuse me, but how is it off topic in a C language group to ask a C
programming question?

Also, do you know that answer to my original question?


You can't do it in C. You have to use some sort of platform-specific
extension. So it's off-topic here. Did you read the Welcome message?




Brian Rodenborn
 
K

Keith Thompson

Listen, your off topic, but while you are, do you know anybody selling a
good cheap toaster? I'm in need.

E-mail me if you've got any leads: (e-mail address removed)

Thanks guys,
CLord.

Clord, you stopped being funny a long time ago. Please go away.
 
I

Irrwahn Grausewitz

Okay, I read the 'welcome message' and read
http://www.albion.com/netiquette/corerules.html, but I still don't
understand why you guys think that I am off topic?

I have asked a perfectly legitimate C question about writing CGI
scripts, and then in those scripts, how to set cookies in a client
browser through Apache.

What of this is off topic?

Because standardized C is the one and only topic here.

Writing CGI scripts to set cookies via apache is not covered by
the C standards - IOW: you have to use implementation-/OS-/application-
dependent extensions to the C language to accomplish your task, and
these are definitely off-topic in comp.lang.c. You should therefore
ask in a newsgroup dedicated to such things.

If, OTOH, you run into problems when writing the actual C code, feel
free to post a reasonable small chunk of example code (with all
non-standard constructs stripped) which exhibits your problem and you
will get help from a lot of people here in c.l.c.

But before doing so, you may want to take a look at the c.l.c-faq,
containing lots of valuable information; it can be accessed at:

http://www.eskimo.com/~scs/C-faq/top.html

Regards

Irrwahn
 
C

clord

Excuse me, but how is it off topic in a C language group to ask a C
programming question?

Shut-up Donny, your out of your element! Oh, wait a minute, I was having
"Big Labowski" flashbacks. Your not Donny, are you?

Also, do you know that answer to my original question?

Can't really remember what it was. Could you re-post it in the form of a
question, sorta like Jeopardy?


But hey, what about my spatula? I'm in the market for a good stainless
steel spatula and thought that this forum, clc, might be the place to find
one. There are so many out there tossing shit around anyway.

clord
 
C

clord

Yours was not a C question, it was a question about
browsers and cookies.

I like to browse for cookies at the groceries store. They have a wide
selection.

C has no knowledge of or support for such.

Really? I thought 'C' was a living, breathing entity fully equipped with
its own mental faculties of reasoning and emotion.


I have a lot to learn Mike. Say hello to "C" for me.


http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html
before posting here again.




Anyone that does should not respond here.
We only discuss (ISO standard) C here.


Maybe you do, but I have often come here to discuss poetry, art, and even
meditation. You should see the things Joona has to say about
transendental meditation. It's enlightening.

By the way, any luck with that spatula?

To both you and 'CLord': Please don't top post.
Thank you.


I'll try, Mike, but it makes me giddy with joy thinking of all the stiff
necks out there who think they invented usenet (like you) and would love
to flame me for doing it.

Come on Mike, admit it, if it weren't for all the flames you post in here
about top posting you'd have nothing else to say. Lord knows you you
couldn't tell the difference between a pointer and the head of your dick
if you were standing naked at the World's First Naked Mrs. Ansi C Contest.


Your Pal,
clord.
 
R

Randy Howard

This admonition probably wasn't helpful.
You didn't even redirect the question to a more appropriate forum.
It would probably have been better not to respond at all.

This admonition probably wasn't helpful.
You didn't even redirect the question to a more appropriate forum.
It would probably have been better not to respond at all.
 
M

Mike Wahler

WA Support said:
Okay, I read the 'welcome message' and read
http://www.albion.com/netiquette/corerules.html, but I still don't
understand why you guys think that I am off topic?

I have asked a perfectly legitimate C question about writing CGI
scripts, and then in those scripts, how to set cookies in a client
browser through Apache.

As we've repeatedly told you, it's not a question about C.
It's a question about CGI, cookies, browsers, and Apache.
None of which are part of C.
What of this is off topic?

CGI
cookies
browser
Apache

Did you not read the welcome message folks have been
referring you too? Please do so before posting here
again. Here's the link again:
http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html


Do you want your problem solved? If so, ask where
it's topical. Or do you just want to argue?

And yet again, I ask you to please not top-post.


-Mike
 
J

Joona I Palaste

clord said:
Maybe you do, but I have often come here to discuss poetry, art, and even
meditation. You should see the things Joona has to say about
transendental meditation. It's enlightening.

I have things to say about that nowadays?

--
/-- Joona Palaste ([email protected]) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"I said 'play as you've never played before', not 'play as IF you've never
played before'!"
- Andy Capp
 
R

Richard Bos

Keith Thompson said:
Clord, you stopped being funny a long time ago. Please go away.

All trolls stopped being funny the day they were born. Please stop
feeding them; Usenet is not a petting zoo.

Richard
 
L

LibraryUser

Randy said:
(e-mail address removed) says... <

This admonition probably wasn't helpful.
You didn't even redirect the question to a more appropriate forum.
It would probably have been better not to respond at all.

Please ignore ERT.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,079
Messages
2,570,574
Members
47,207
Latest member
HelenaCani

Latest Threads

Top