[Catalyst] Session Wipeout
Our catalyst app is having a problem with sessions. We have a calendar that is called via ajax and sometimes takes 45 seconds to load (optimizing this is in the works). The problem is if you navigate away from that page and start clicking around, the session is being updated just fine until that ajax call finishes. Then the session is over-written and all the previous session data is wiped out. Is there a way I can have that ajax call not write the session data? I'm using: Session Session::State::Cookie Session::State::URI Session::Store::DBIC Thanks in advance! Ryan Pack Programmer Genares Worldwide Reservations P. 817-722-2834 F. 817-442-0600 ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
RE: [Catalyst] Invalid session ids being generated
The problem is I was not able to duplicate this on our development or test servers. Only on production and unfortunately we don't have time right now to set up a duplicate site on production for debugging this issue. The code is the same, the only differences are we use a load balancer with 3 web servers and use mysql replication. If we can get caught up I may spend some more time on it. Ryan Pack Programmer Genares Worldwide Reservations P. 817-722-2834 F. 817-442-0600 -Original Message- From: Jonathan Rockway [mailto:[EMAIL PROTECTED] Sent: Saturday, May 10, 2008 8:39 PM To: The elegant MVC web framework Subject: Re: [Catalyst] Invalid session ids being generated * On Fri, May 09 2008, Hartmaier Alexander wrote: Delete the session cache file! I had a similar problem. -Alex -Original Message- From: Ryan Pack [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 1:03 AM To: The elegant MVC web framework Subject: RE: [Catalyst] Invalid session ids being generated I was able to fix it by downgrading Catalyst::Plugin::Session. We were on 0.13 until I upgraded to .19 (latest) along with a bunch of other Catalyst modules. Just as a last resort before I downgraded everything back to the way it was I tried just downgrading Catalyst::Plugin::Session and it worked! Woohoo! Both of these sound like fragile workarounds. If you guys can do a bit more digging, I would appreciate it. It would be good to actually fix the problems, after all. Regards, Jonathan Rockway -- print just = another = perl = hacker = if $,=$ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
RE: [Catalyst] Invalid session ids being generated
Ok, I think I have enough information to explain the problem better. When a request is made to the app a session id is created in the db but there is no session data and the expires field is null. The cookie is set with that session id. When you make a subsequent request, the error below is logged and the first session id is deleted automatically. A new session id is created and this time session data is populated as well as expires. A new cookie is set with the good session id and all is well. I am going to dig into why the first session created is invalid, but I'm rather new to Catalyst and I can use any suggestions you can offer. Thanks! Ryan Pack Programmer Genares Worldwide Reservations P. 817-722-2834 F. 817-442-0600 From: Ryan Pack [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 07, 2008 9:25 PM To: The elegant MVC web framework Subject: RE: [Catalyst] Invalid session ids being generated I forgot to include the error in the log: FastCGI: server /u/lxlib/BookingEngine/script/bookingengine_fastcgi.pl stderr: [error] Caught exception in engine DBIx::Class::Relationship::CascadeActions::update(): Can't update BookingEngine::Model::DBIC::BE::Session=HASH(0xd3f2620): row not found at /usr/lib/perl5/site_perl/5.8.5/Catalyst/Plugin/Session/Store/DBIC/Delega te.pm line 85 Ryan Pack Programmer Genares Worldwide Reservations P. 817-722-2834 F. 817-442-0600 From: Ryan Pack [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 07, 2008 5:38 PM To: catalyst@lists.scsys.co.uk Subject: [Catalyst] Invalid session ids being generated My Catalyst app is using Session::State::Cookie, Session::State::URI, and Session::Store::DBIC. We recently started using the param option in Session::State::URI. We were tacking the session id onto the base URL but now it is being included as a parameter. Anyways, when you first make a request, a cookie is set with a valid session_id but uri_for returns the url with a totally different session id which doesn't even exist in the database. We are including the uri_for generated url for form actions and links, etc. in our templates in case cookies are disabled. Has anyone seen this before? Ryan Pack Programmer Genares Worldwide Reservations P. 817-722-2834 F. 817-442-0600 ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
RE: [Catalyst] Invalid session ids being generated
I was able to fix it by downgrading Catalyst::Plugin::Session. We were on 0.13 until I upgraded to .19 (latest) along with a bunch of other Catalyst modules. Just as a last resort before I downgraded everything back to the way it was I tried just downgrading Catalyst::Plugin::Session and it worked! Woohoo! Ryan Pack Programmer Genares Worldwide Reservations P. 817-722-2834 F. 817-442-0600 -Original Message- From: Daniel Westermann-Clark [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 2:00 PM To: The elegant MVC web framework Subject: Re: [Catalyst] Invalid session ids being generated On 2008-05-07 17:38:12 -0500, Ryan Pack wrote: My Catalyst app is using Session::State::Cookie, Session::State::URI, and Session::Store::DBIC. We recently started using the param option in Session::State::URI. We were tacking the session id onto the base URL but now it is being included as a parameter. Anyways, when you first make a request, a cookie is set with a valid session_id but uri_for returns the url with a totally different session id which doesn't even exist in the database. Please send the output of a full request cycle using the debug flag. For example, with the built-in server: DBIC_TRACE=1 ./script/*server.pl -r -d I'm not sure that using two Session::State plugins is recommended. At the very least, have you set the no_rewrite_if_cookie flag for Session::State::URI? -- Daniel Westermann-Clark ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
RE: [Catalyst] FastCGI: incomplete headers (0 bytes) received fromserver
Thanks everyone for your replies. Turns out that this error had nothing to do with the problem I am trying to track down. I will post a new thread with a more appropriate subject line. Ryan Pack Programmer Genares Worldwide Reservations P. 817-722-2834 F. 817-442-0600 From: Martin Ellison [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 07, 2008 1:03 AM To: The elegant MVC web framework Subject: Re: [Catalyst] FastCGI: incomplete headers (0 bytes) received fromserver The error is presumably because your fast cgi system has a timeout. Do you have some code that sometimes takes a long time to run? If it only happens about 1% of the time it may be normally just quicker than the limit, but occasionally going over. 2008/5/7 John Goulah [EMAIL PROTECTED]: On Tue, May 6, 2008 at 1:01 PM, Ryan Pack [EMAIL PROTECTED] wrote: I'm having an issue with my Catalyst app but I can only get it to break about 1 in 100 tries. The error log shows: [Tue May 06 11:02:46 2008] [error] [client 12.37.36.66] FastCGI: comm with server /u/lxlib/BookingEngine/script/bookingengine_fastcgi.pl aborted: idle timeout (60 sec), referer: http://be.genares.net/11 [Tue May 06 11:02:46 2008] [error] [client 12.37.36.66] FastCGI: incomplete headers (0 bytes) received from server /u/lxlib/BookingEngine/script/bookingengine_fastcgi.pl, referer: http://be.genares.net/11 For what its worth, I also get the latter error quite a bit in my error logs. Haven't really had time to trace it down, looks similar something like: [Tue May 06 10:09:34 2008] [error] [client 204.2.215.55] FastCGI: incomplete headers (0 bytes) received from server /opt/myapp.com/app/MyApp/1.007556/fake/www I think the only thing in common here is Session::State::Cookie; we use Session::Store::Cache. Probably doesn't help much but I guess the problem does exist for various reasons if anyone has any ideas I'd be glad to try, but adding some debug messages in key places isn't going to cut it. ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ -- Regards, Martin ([EMAIL PROTECTED]) IT: http://methodsupport.com Personal: http://thereisnoend.org ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Invalid session ids being generated
My Catalyst app is using Session::State::Cookie, Session::State::URI, and Session::Store::DBIC. We recently started using the param option in Session::State::URI. We were tacking the session id onto the base URL but now it is being included as a parameter. Anyways, when you first make a request, a cookie is set with a valid session_id but uri_for returns the url with a totally different session id which doesn't even exist in the database. We are including the uri_for generated url for form actions and links, etc. in our templates in case cookies are disabled. Has anyone seen this before? Ryan Pack Programmer Genares Worldwide Reservations P. 817-722-2834 F. 817-442-0600 ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
RE: [Catalyst] Invalid session ids being generated
I forgot to include the error in the log: FastCGI: server /u/lxlib/BookingEngine/script/bookingengine_fastcgi.pl stderr: [error] Caught exception in engine DBIx::Class::Relationship::CascadeActions::update(): Can't update BookingEngine::Model::DBIC::BE::Session=HASH(0xd3f2620): row not found at /usr/lib/perl5/site_perl/5.8.5/Catalyst/Plugin/Session/Store/DBIC/Delega te.pm line 85 Ryan Pack Programmer Genares Worldwide Reservations P. 817-722-2834 F. 817-442-0600 From: Ryan Pack [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 07, 2008 5:38 PM To: catalyst@lists.scsys.co.uk Subject: [Catalyst] Invalid session ids being generated My Catalyst app is using Session::State::Cookie, Session::State::URI, and Session::Store::DBIC. We recently started using the param option in Session::State::URI. We were tacking the session id onto the base URL but now it is being included as a parameter. Anyways, when you first make a request, a cookie is set with a valid session_id but uri_for returns the url with a totally different session id which doesn't even exist in the database. We are including the uri_for generated url for form actions and links, etc. in our templates in case cookies are disabled. Has anyone seen this before? Ryan Pack Programmer Genares Worldwide Reservations P. 817-722-2834 F. 817-442-0600 ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] FastCGI: incomplete headers (0 bytes) received from server
I'm having an issue with my Catalyst app but I can only get it to break about 1 in 100 tries. The error log shows: [Tue May 06 11:02:46 2008] [error] [client 12.37.36.66] FastCGI: comm with server /u/lxlib/BookingEngine/script/bookingengine_fastcgi.pl aborted: idle timeout (60 sec), referer: http://be.genares.net/11 [Tue May 06 11:02:46 2008] [error] [client 12.37.36.66] FastCGI: incomplete headers (0 bytes) received from server /u/lxlib/BookingEngine/script/bookingengine_fastcgi.pl, referer: http://be.genares.net/11 The page does not show an error, but a new session is created instead of using the existing session. I'm using Session::State::Cookie, Session::State::URI, Session::Store::DBIC. All are on the latest versions. Any help would be appreciated. Ryan Pack Programmer Genares Worldwide Reservations P. 817-722-2834 F. 817-442-0600 ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Sessions and Cookies
I have a catalyst app that uses Catalyst::Plugin::Session, Session::State::Cookie, Session::State::URI, and Session::Store::DBIC to handle sessions. I didn't write the app but I'm trying to change it's behavior for new sessions. Currently when a request is made, the app looks for a cookie with a valid session. If one is NOT found it adds the newly created session id to the URL, which is visible in the browser. All subsequent requests made will not have the session id in the URL because the cookie was retrieved. My question is, how can I not show the session id in the URL for the first request? I don't want to use javascript to redirect once the cookie is first set because a POST request would screw up some other stuff we have going on. I would like to send just the headers to set the cookie and somehow check to see if it was set properly (cookies not blocked) and then just send the response without the session id in the URL. Looking for any advise on the best way to do this. I greatly appreciate it. Ryan Pack Programmer GenaRes Worldwide Reservations ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Environment Variables
Hello all. First time posting here. :-) I'm trying to get at $ENV{HTTP_REFERER} from my catalyst app but it doesn't seem to be there. In fact the only keys that exist in %ENV are CATALYST_ENGINE and PERL5LIB. Are the others being wiped out somehow? Not sure if this is normal Catalyst behavior. Thanks! Ryan Pack ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
RE: [Catalyst] Environment Variables
Excellent, thanks! Ryan Pack -Original Message- From: Ashley [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 27, 2008 4:45 PM To: The elegant MVC web framework Subject: Re: [Catalyst] Environment Variables On Feb 27, 2008, at 2:39 PM, Ryan Pack wrote: Hello all. First time posting here. J I'm trying to get at $ENV{HTTP_REFERER} from my catalyst app but it doesn't seem to be there. In fact the only keys that exist in %ENV are CATALYST_ENGINE and PERL5LIB. Are the others being wiped out somehow? Not sure if this is normal Catalyst behavior. Thanks! That info is in $c-request-referer _when_ it's present. Generally you want to avoid the ENV stuff, though I believe there is a plugin to get at it if you really need some part of it not already exposed. -Ashley ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/