Skip Menu |
 

This queue is for tickets about the CGI-Session CPAN distribution.

Report information
The Basics
Id: 20130
Status: resolved
Priority: 0/
Queue: CGI-Session

People
Owner: Nobody in particular
Requestors: gavin.phillips70 [...] ntlworld.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.95
Fixed in: (no value)



Subject: Problem ignoring cookies
Download (untitled) / with headers
text/plain 727b
Hi, I'm not sure if this is a bug or not but thought I would post it here to see if anyone is able to help please. I have a situation where I am wanting to create a new session each time a new login is instigated. E.g: $session = new CGI:Session(undef, undef, {Directory=>$session_path}); However, if a cookie has been previously set this is being used instead of creating a brand new clean session. It is taking the cookie from $cgi->cookie. There are a certain set of circumstance where I do not want to use the cookie but simply create a brand new session, I thought the code above would do the trick. Do you have any ideas on how I can ignore this cookie and generate a new session id? Any help is appreciated.
CC: gavin.phillips70 [...] ntlworld.com
Subject: Re: [rt.cpan.org #20130] Problem ignoring cookies
Date: Wed, 28 Jun 2006 23:22:48 -0500
To: bug-CGI-Session [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
Download (untitled) / with headers
text/plain 1.1k
Show quoted text
> > I'm not sure if this is a bug or not but thought I would post it here to > see if anyone is able to help please.
Gavin, In the future, please post such questions to the mailing list, which several people read, instead of the bug tracker, which only notifies one or two of us by e-mail, and requires someone to log-in and manage the ticket at some point. Show quoted text
> I have a situation where I am > wanting to create a new session each time a new login is instigated. > E.g: $session = new CGI:Session(undef, undef,
{Directory=>$session_path}); Show quoted text
> > However, if a cookie has been previously set this is being used instead > of creating a brand new clean session. It is taking the cookie from > $cgi->cookie. There are a certain set of circumstance where I do not > want to use the cookie but simply create a brand new session, I thought > the code above would do the trick. > > Do you have any ideas on how I can ignore this cookie and generate a new > session id?
I think there is a method called is_new(), and another one called clear(). Check the documentation for details. I'd probably recommend just clearing out the old session instead of creating another one. Mark
From: SHERZODR [...] cpan.org
Download (untitled) / with headers
text/plain 241b
Another trick is, just send some other string as a session id, and it will be forced to create a new session after failing to load any previously saved sessions: $s = CGI::Session->new(undef, "GIMMENEWSESSION", {Directory=>'/tmp'});


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.