This is not a bad idea and in fact we have used to prevent session write
locking as we would have multiple ajax requests running on a page load each
with semi-lengthy processes running that would force the ajax requests to
queue instead of run asynchronously because of session write locking. By
calling $this->getUser()->shutdown() you are forcing symfony to write to all
data sent via $this->getUser()->setAttribute() to the actual session
variables.

Just remember. Any $this->getUser()->setAttribute() calls will not work
after calling shutdown() because you will be storing the variables in
symfony's session "placeholder" that never gets written to session because
you have already called shutdown().

On Wed, Sep 8, 2010 at 11:03 AM, Phil Moorhouse <moorhouse.p...@gmail.com>wrote:

> The answer is: yes - $this->getUser()->shutdown() seems to work.
>
> If anyone knows of a particular reason why this might be a bad idea,
> please let me know.
>
> On 8 Sep, 09:10, Phil Moorhouse <moorhouse.p...@gmail.com> wrote:
> > The site needs to work with javascript disabled so unfortunately
> > that's not an option at present.
> >
> > Adding a delay seems a bit of an unreliable way to work around the
> > problem due to not being able to guarantee how long A1 will take to
> > finish sending content.
> >
> > Is there definitely no way to force a session write from an action?
> > Would calling $this->getUser()->shutdown() do it?
> >
> > On 7 Sep, 17:17, pghoratiu <pghora...@gmail.com> wrote:
> >
> > > The session is closed after all content is sent from A1.
> > > You should find a way to delay the load of the iframe (via Javascript
> > > maybe) to make sure that A1 has completed and that A2 can load the new
> > > content.
> >
> > >     gabriel
> >
> > > On Sep 7, 6:04 pm, Phil Moorhouse <moorhouse.p...@gmail.com> wrote:
> >
> > > > Hi, I currently have an action (A1) that performs some manipulation
> of
> > > > objects saved in the session, and then loads a view containing an
> > > > iframe.
> >
> > > > The iframe loads another action (A2) from the same application which
> > > > relies on objects saved to the session in A1. Sometimes, particularly
> > > > when accessing remotely, the objects do not seem to be present in the
> > > > session and A2 throws a fatal error.
> >
> > > > After some discussion in IRC, it seems like A2 is probably loading
> the
> > > > session before A1 has finished writing to it. This seems counter-
> > > > intuitive, but I can't think of any other explanation.
> >
> > > > Is it possible to flush writes to the session from an action (A1) so
> > > > that I can be sure the data has been saved?
> >
> > > > This is on a symfony 1.0 site and using sfMemcacheSessionStorage
> fromhttp://www.symfony-project.org/plugins/sfMemcachePlugin.
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to