Cookie without using something external (ie CGI.pm or something else):

Hi, I've the need to set cookies using perl.
But I've not the possibility to use modules.
ANyone has an idea how to read and write cookies in a script?
(IE to have 2 functions : set_cookie and read_cookie)
Thankyou
zuppyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

malecCommented:
just put

Set-cookie: <name>=<value>; expires=<date/time> content-type: text/html

followed by 2 blank lines into header;
This will set a cookie <name> to <value>

Retrieve cookie from Environment variable HTTP_COOKIE
0
zuppyAuthor Commented:
can you specify the syntax of:


 expires=<date/time>  (date /time)

and the sintax  of

HTTP_COOKIE ?

Thanks :D
0
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

zuppyAuthor Commented:
Thanks , so to who I must give points?:D
0
malecCommented:
It's up to you, but I don't mind if you give them to me.
0
zuppyAuthor Commented:
Last question:

in the page specifield by ozo there is the passage
"
expires is an optional attribute. If not specified, the cookie will expire when the user's session ends."

it refers to broswer's session or to OS's sessions?

There is a big difference.
0
malecCommented:
Browser of course.
0
malecCommented:
Browser of course.

BTW syntax for HTTP_COOKIE is
$ENV{HTTP_COOKIE}, just like for any other environment variable.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.