Hi Everyone
I posted this in the symfony-users group but didnt get any answer.
Can someone tell me how I can make sessions work if I set  
auto_start=false?
Right now I  check if session_id returns an empty string before  
creating a new session based on a URL parameter. But then when the  
request is finished, any updates to the session are not saved.

Any help would be appreciated.
Thanks
Balaji


Begin forwarded message:

> From: Balaji Srinivasan <[EMAIL PROTECTED]>
> Date: May 6, 2008 11:10:28 PM PDT
> To: [EMAIL PROTECTED]
> Subject: Re: [symfony-users] Re: Turning off session auto_start  
> causes flash to not work
>
> Thanks for your reply Eno.
>
> I check if the session exists (ie I create a new session only if  
> session_id() returns an empty string).
> I didnt know that getAttribute and setAttribute will not work if i  
> turn off session auto_start. What should I do to have it persist the  
> complete session information?
>
> (I didnt know turning off auto_start also turned off saving session  
> data at the end of the request. This might be the explanation why  
> flash doesnt work since it also uses the setAttribute, getAttribute  
> calls)
>
> Any Symfony developers here that can answer this question?
> Thanks
> Balaji
>
> On May 6, 2008, at 9:50 PM, Eno wrote:
>
>>
>> On Mon, 5 May 2008, Balaji Srinivasan wrote:
>>
>>> So I turned off session. auto_start in factories.yml.
>>> In my preExecute method, I set up a session using session_id() call.
>>>
>>> Now it looks like the flash parameters are no longer being carried
>>> from one call to the next. Also somehow the session itself doesnt  
>>> get
>>> restored on the next call (ie. If I add an attribute to the session
>>> using $this->getUser()->setAttribute(), I cannot retrieve it in the
>>> next call).
>>
>> preExecute() gets called for every action, so do you check for an  
>> existing
>> session to use and use it or create a new one each time?
>>
>> Im also guessing switching off symfony's session handling means you  
>> dont
>> get to use methods like getAttribute() and setAttribute(). Probably  
>> you'll
>> need to write your own methods to handle storing and retrieving  
>> session
>> data instead of using Symfony's.
>>
>>
>> -- 
>>
>>
>>
>> >>
>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to