Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^2: always logged in with CGI::Session

by boboson (Monk)
on Mar 24, 2006 at 19:32 UTC ( #539080=note: print w/replies, xml ) Need Help??

in reply to Re: always logged in with CGI::Session
in thread always logged in with CGI::Session

Yep, your'e right the (s) shouldn't be there. However it still works with the (s)??? Don't ask me why!
I read in a post doing a supersearch that if you don't supply the expire, the session would expire when the browser window is closed. This doesn't seem to be true, or it is true and my application always gives me the same sessionid.
It sure feels like it always gives me the same session id. I use the name() function to shorten the "CGISESSID" name variable to just "sid", because if a user doesn't have cookies activated I can send the sessionid with a name of my choice like this:
# get sessionid for querystring if ($q->cookie('sid') ne $session->id()) { $tmpl->param(sid => "&sid=".$session->id()); }
Do you have any clue how to prevent the same sessionid to be set?

Replies are listed 'Best First'.
Re^3: always logged in with CGI::Session
by bibliophile (Parson) on Apr 03, 2006 at 16:15 UTC
    Sorry, I've been out of the office for the last week :-)

    I'm only guessing here... but take a look at: session_config. Maybe you want to use that in your init_session routine, rather than using CGI::Session->name()?

    Let me know if that changes anything - I'm quite curious (as I'll be needing something like this myself in a while!)


    -- WARNING: You are logged into reality as root.
      I am not sure yet, haven't done to much testing. But it seems to work. I removed the name and the session header calls.
      sub init_session { # application object my $self = shift; my $name = shift; # change name from CGISESSID to shorter sid #CGI::Session->name($name); # init session object using CGI::Application::Plugin::Session my $session = $self->session; # send session to header #$session->header(); }
        Interesting. It might be worth asking the author of C::A::Plugin::Session about that.


        -- WARNING: You are logged into reality as root.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://539080]
[Happy-the-monk]: LanX: for what? Being more successful selling old stories than her antecedents?
[Happy-the-monk]: (now all you need to do is answer: "no, for money." ;-))

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2018-04-20 11:49 GMT
Find Nodes?
    Voting Booth?