For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > October 2005 > sessions









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author sessions
Adriano Allora

2005-10-31, 6:56 pm

hi to all,
I use session (CGI::Sessions) to record some data in a textual
search-engine (CQP). I have this problem: I need to destroy a session
before starting the new one, but I cannot.

actually I wrote this code:


$qualecookie = $pagina->cookie(CGIRICERCA);
if($qualecookie)
{
$session = new CGI::Session(undef, $qualecookie,
{Directory=>'/tmp'});
$session->delete();
}

the cookie CGIRICERCA store the session ID, so, when the user come
again in the first page I verify his/her cookie: if (s)he has the
cookie I delete the session... er, I would delete it.
Someone can show me the error?


another way to solve my problem would be deleting the cookie only, for
example with:

$pagina->cookie(-name=>'CGIRICERCA',-value=>"");

but: how can I delete a cookie before a redirection (without header
writing)?


thank you all,

alladr

|^|_|^|_|^| |^|_|^|_|^|
| | | |
| | | |
| |*\_/*\_/*\_/*\_/*\_/* | |
| |
| |
| |
| http://www.e-allora.net |
| |
| |
**************************************

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com