i want to create a perl /CGI program Cookie, where the username can be remembered even if the browser is shut down and restarted. i am new to Perl programming, and i have no clue from where to start on this, but i am aware on how to set cookies, but when the browser is quit the saved values disappear..

so will some one plzzz help me with a sample code :( i am lost

Recommended Answers

All 4 Replies

Are you familiar with the CGI module? You can set and read cookies with the module. See the CGI documentation for details.


There is also the CGI::Cookie module

i couldn't find any thing productive there..

wat i want to do is to create a perl persistent cookie ?? how do u code for this

There is no such thing as a perl cookie. On the server end they are generally refered to as sessions, on the client side, they are called cookies. But there is no such thing as a perl cookie so I am not sure what you are wanting to do.

Use an HTTP Cookie from the perl module mentioned above and set an expiration date into the future. That will store the cookie on the client's machine and it will retransmit it to your server. But storing the username is not a very secure solution.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.