Update!
Session name was problematic with non-alphanumeric characters. So here
is an update
class dotTVSessionStorage extends sfSessionStorage
{
  /**
   * This override sets the exact (sub)domain for session cookie and
then initializes this Storage instance.
   *
   * @param sfContext A sfContext instance
   * @param array   An associative array of initialization parameters
   *
   * @return boolean true, if initialization completes successfully,
otherwise false
   *
   * @throws <b>sfInitializationException</b> If an error occurs while
initializing this Storage
   */
  public function initialize($context, $parameters = null)
  {
    $parameters['session_name'] = 'dottv2'.ereg_replace("[^A-Za-z0-9]",
"", $_SERVER['SERVER_NAME']);

    // initialize parent
    parent::initialize($context, $parameters);
  }

}

Haris Zukanovic' wrote:
> Nope!
> I had to inherit from sfSessionStorage to make it work..
> Also, I just couldn't get it to work with domain limitations in that
> Explorer seems to send the cookies of the main domain to all subdomains.
> So I had to use a subdomain-based session name
> Here is the code bit, at the end it came out pretty simple, but I used
> hours trying to get it to work with domain limiting the cookies
>
> class mySessionStorage extends sfSessionStorage
> {
>   /**
>    * This override sets the exact (sub)domain for session cookie and
> then initializes this Storage instance.
>    *
>    * @param sfContext A sfContext instance
>    * @param array   An associative array of initialization parameters
>    *
>    * @return boolean true, if initialization completes successfully,
> otherwise false
>    *
>    * @throws <b>sfInitializationException</b> If an error occurs while
> initializing this Storage
>    */
>   public function initialize($context, $parameters = null)
>   {
> //    $parameters['session_cookie_domain'] = $_SERVER['SERVER_NAME'];
> // This doesn't work
>     $parameters['session_name'] = 'symfony_'.$_SERVER['SERVER_NAME'];
> // This works
>     // initialize parent
>     parent::initialize($context, $parameters);
>   }
>
> }
>
>
>
> Ian P. Christian wrote:
>> Haris Zukanovic' wrote:
>>   
>>> I know, but I want to have different sessions for each subdomain!
>>> I have more subdomains poining at the same application.
>>>   
>>>     
>>
>> I imagine you can probably change this on a per domain basis using a Filter.
>>
>>
>>   
>
> -- 
> Haris Zukanovic
> CEO
> Software development and research
> International Business Development, SOFTING ltd.
>  
>
> office  +387 36 318 339
> GSM     +387 61 839 069
>  
> http://www.eu-softing.com
>
>
>
>
>  
> CONFIDENTIALITY NOTICE
> This e-mail and any attached files, sent by a company e - mail system, 
> contains company confidential and/or privileged information and is intended 
> only for the person or entity to which it is addressed and only for the 
> purposes therein set forth. If you are not the intended recipient (or have 
> received this e-mail in error) please notify the sender immediately and 
> destroy this e-mail. Any unauthorized copying, disclosure, distribution or 
> other use of, or taking of any action in reliance upon, the material in this 
> e-mail by persons or entities other than the intended recipient is strictly 
> forbidden.
>   
>
> >

-- 
Haris Zukanovic
CEO
Software development and research
International Business Development, SOFTING ltd.
 

office  +387 36 318 339
GSM     +387 61 839 069
 
http://www.eu-softing.com




 
CONFIDENTIALITY NOTICE
This e-mail and any attached files, sent by a company e - mail system, contains 
company confidential and/or privileged information and is intended only for the 
person or entity to which it is addressed and only for the purposes therein set 
forth. If you are not the intended recipient (or have received this e-mail in 
error) please notify the sender immediately and destroy this e-mail. Any 
unauthorized copying, disclosure, distribution or other use of, or taking of 
any action in reliance upon, the material in this e-mail by persons or entities 
other than the intended recipient is strictly forbidden.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to