Odd session behaviour - plackup vs starman

View: New views
4 Messages — Rating Filter:   Alert me  

Odd session behaviour - plackup vs starman

by Dane Buson :: Rate this Message:

| View Threaded | Show Only this Message

I'm having trouble where things I store in session work in Plackup, but not Starman.

I'm getting an undefined for my $myid variable in Starman but not in Plackup.

Code:



<%init>
        my $session = $m->req->session;
        my $myid = $session->{myid};


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mason-users mailing list
Mason-users@...
https://lists.sourceforge.net/lists/listinfo/mason-users

Re: Odd session behaviour - plackup vs starman

by Jonathan Swartz :: Rate this Message:

| View Threaded | Show Only this Message

How is the session middleware configured?

On May 2, 2012, at 10:58 AM, Dane Buson wrote:

> I'm having trouble where things I store in session work in Plackup, but not Starman.
>
> I'm getting an undefined for my $myid variable in Starman but not in Plackup.
>
> Code:
>
>
>
> <%init>
>         my $session = $m->req->session;
>         my $myid = $session->{myid};
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________
> Mason-users mailing list
> Mason-users@...
> https://lists.sourceforge.net/lists/listinfo/mason-users


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mason-users mailing list
Mason-users@...
https://lists.sourceforge.net/lists/listinfo/mason-users

Parent Message unknown Re: Odd session behaviour - plackup vs starman

by Jonathan Swartz :: Rate this Message:

| View Threaded | Show Only this Message

Please keep replies on the mailing list, thanks.

You need to use $session->set and $session->get. Otherwise you are just setting the in-memory hash, which would only work in a single-process server like plackup.

You need to use the File store for the same reason - Starman has multiple processes.

HTH
Jon

On May 2, 2012, at 12:00 PM, Dane Buson wrote:

builder {
    # Include PSGI middleware here
    enable 'Session';
    $app;
};

I tried using file Session, and didn't see different behavior.

      enable "Session", store => "File";

Versions:

Starman 0.3000
Plack 0.9972

Thanks.


On Wed, May 2, 2012 at 11:44 AM, Jonathan Swartz <swartz@...> wrote:
How is the session middleware configured?

On May 2, 2012, at 10:58 AM, Dane Buson wrote:

> I'm having trouble where things I store in session work in Plackup, but not Starman.
>
> I'm getting an undefined for my $myid variable in Starman but not in Plackup.
>
> Code:
>
>
>
> <%init>
>         my $session = $m->req->session;
>         my $myid = $session->{myid};
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________
> Mason-users mailing list
> Mason-users@...
> https://lists.sourceforge.net/lists/listinfo/mason-users




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mason-users mailing list
Mason-users@...
https://lists.sourceforge.net/lists/listinfo/mason-users

Re: Odd session behaviour - plackup vs starman

by Dane Buson :: Rate this Message:

| View Threaded | Show Only this Message

Ah thanks!  That makes tremendous sense.

On Thu, May 3, 2012 at 4:27 AM, Jonathan Swartz <swartz@...> wrote:
Please keep replies on the mailing list, thanks.

You need to use $session->set and $session->get. Otherwise you are just setting the in-memory hash, which would only work in a single-process server like plackup.

You need to use the File store for the same reason - Starman has multiple processes.

HTH
Jon

On May 2, 2012, at 12:00 PM, Dane Buson wrote:

builder {
    # Include PSGI middleware here
    enable 'Session';
    $app;
};

I tried using file Session, and didn't see different behavior.

      enable "Session", store => "File";

Versions:

Starman 0.3000
Plack 0.9972

Thanks.


On Wed, May 2, 2012 at 11:44 AM, Jonathan Swartz <swartz@...> wrote:
How is the session middleware configured?

On May 2, 2012, at 10:58 AM, Dane Buson wrote:

> I'm having trouble where things I store in session work in Plackup, but not Starman.
>
> I'm getting an undefined for my $myid variable in Starman but not in Plackup.
>
> Code:
>
>
>
> <%init>
>         my $session = $m->req->session;
>         my $myid = $session->{myid};
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________
> Mason-users mailing list
> Mason-users@...
> https://lists.sourceforge.net/lists/listinfo/mason-users





------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mason-users mailing list
Mason-users@...
https://lists.sourceforge.net/lists/listinfo/mason-users