PDA

View Full Version : Need help with Perl Session tracking



tdkrause1
12 May 2008, 10:15 AM
I'm just starting to learn perl and was wondering how to get started with session tracking. All I want to do is have a simple session variable that tells the time of the last visit to a page. How do I declare a new session? Do I have to explicitly declare a cookie? After that, how do I access the variables in the cookie? I have only done this in Java which has a built in session variable.

tdkrause1
12 May 2008, 08:18 PM
Ok, so I figured out a little bit about using cookies but I'm still wondering how to assign multiple variables to a single cookie.
The syntax I'm currently using is:

$value = cookie('last_visit');
$some_cookie=cookie(-name => 'last_visit',
-value => $some value,
-expires => '+1y');

any suggestions?