Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > creating a new session when a session is expired

Reply
Thread Tools

creating a new session when a session is expired

 
 
alexjaquet@gmail.com
Guest
Posts: n/a
 
      05-17-2006
Hi,

After reading the documentation about CGI::Session I didn't find any
way to create a session when it's expired.

Now I'm using the following code to create a new session

local our $session_id=$query->param('session');
if ($session_id eq '' or $session_id eq '$SESSIONID') {
$session = new CGI::Session("driver:File", undef,
{Directory=>"$session_dir"});
$session->expire(3600);
$session_id = $session->id();
}

how can I extend this piece of code when a session exist but expired ?

Thanks for your advice.

Alexandre JAQUET

 
Reply With Quote
 
 
 
 
xhoster@gmail.com
Guest
Posts: n/a
 
      05-17-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Hi,
>
> After reading the documentation about CGI::Session I didn't find any
> way to create a session when it's expired.


docs for new():
If called with a single argument, it will be treated
either as $query object, or $sid, depending on its
type. If argument is a string , "new()" will treat it
as session id and will attempt to retrieve the session
from data store. If it fails, will create a new ses-
sion id, which will be accessible through id() method.

So you call new with the claimed session id if there is one. If it had
expired, or doesn't exist in the first place, a new session will be created
automatically. Otherwise the old one will be retrieved.

> Now I'm using the following code to create a new session
>
> local our $session_id=$query->param('session');
> if ($session_id eq '' or $session_id eq '$SESSIONID') {


Where does $SESSIONID get set? What does it get set to?

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
 
Reply With Quote
 
 
 
 
xhoster@gmail.com
Guest
Posts: n/a
 
      05-17-2006
http://www.velocityreviews.com/forums/(E-Mail Removed)-here.net wrote:
> (E-Mail Removed) writes:
> > > Now I'm using the following code to create a new session
> > >
> > > local our $session_id=$query->param('session');
> > > if ($session_id eq '' or $session_id eq '$SESSIONID') {

> >
> > Where does $SESSIONID get set? What does it get set to?

>
> It doesn't get set to ANYTHING, it's a string that looks confusingly
> like a variable.


Ah, yes. I missed that. I not sure if that makes things clearer or
even less clear.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CGI::Session How can a session be not expired and at the same time empty? djbonnici@gmail.com Perl Misc 0 06-14-2007 07:56 PM
Session Expired be4 timeout Plz Help me urgently net4matrimonials@gmail.com ASP .Net 0 12-07-2005 05:35 AM
session expired? szabelin ASP .Net 1 08-29-2003 10:17 PM
Session Expired error Lenny ASP .Net 1 07-31-2003 04:33 PM
Session Expired (sessionState mode="SQLServer") TSelvan ASP .Net 1 07-30-2003 05:13 AM



Advertisments