[symfony-users] Re: Same session for All subdomains
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 sfInitializationException 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 sfInitializationException 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 symfony-users@googlegroups.com 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 -~--~~~~--~~--~--~---
[symfony-users] Re: Same session for All subdomains
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 sfInitializationException 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. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Same session for All subdomains
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. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Same session for All subdomains
Comments bellow .. Eno wrote: > On Oct 2, 6:20 am, Haris Zukanovic' <[EMAIL PROTECTED]> wrote: > > >> I have not setup any params for sfSessionStorage in factories.yml and >> when using >> >> Internet Explorer 6 is using the same session for following domains >> test.website.com >> nr1.test.website.com >> nr2.test.website.com >> >> In firefox, the sessions are different for each of the domains? >> Why is this? >> > > It shouldn't be if you set the cookie name to use a wildcard for the > domain in factories.yml, i.e. > > session_name: sitename > session_cookie_domain: .example.com > > > I know, but I want to have different sessions for each subdomain! I have more subdomains poining at the same application. Firefox is acting as I expect. But Explorer is not. It is sending the same session cookies to all subdomains > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Same session for All subdomains
On Oct 2, 6:20 am, Haris Zukanovic' <[EMAIL PROTECTED]> wrote: > I have not setup any params for sfSessionStorage in factories.yml and > when using > > Internet Explorer 6 is using the same session for following domains > test.website.com > nr1.test.website.com > nr2.test.website.com > > In firefox, the sessions are different for each of the domains? > Why is this? It shouldn't be if you set the cookie name to use a wildcard for the domain in factories.yml, i.e. session_name: sitename session_cookie_domain: .example.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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Same session for All subdomains
Hi, I have not setup any params for sfSessionStorage in factories.yml and when using Internet Explorer 6 is using the same session for following domains test.website.com nr1.test.website.com nr2.test.website.com In firefox, the sessions are different for each of the domains? Why is this? I need different sessions for each subdomain TIA Haris Francois Zaninotto wrote: > Muhammad, > > Take a look at this post: > > http://groups.google.com/group/symfony-users/msg/e8b39c394458acb7 > > Francois > *De :* symfony-users@googlegroups.com > [mailto:[EMAIL PROTECTED] *De la part de* Muhammad Asif Ali > *Envoyé :* jeudi 3 mai 2007 10:27 > *À :* symfony-users > *Objet :* [symfony-users] Same session for All subdomains > > Hi All, > I am using wild card DNS. every register > user will get his own subdomain. The session is different for each > subdmain. How can i make the common session to all the subdomains . > > Thanks in advance :o) > > > Regards > Muhammad Asif Ali > > > > -- 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 symfony-users@googlegroups.com 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 -~--~~~~--~~--~--~---
[symfony-users] Re: Same session for All subdomains
Thank All its working now On May 4, 3:38 am, "Francois Zaninotto" <[EMAIL PROTECTED] project.com> wrote: > Muhammad, > > Take a look at this post: > > http://groups.google.com/group/symfony-users/msg/e8b39c394458acb7 > > Francois > > _ > > De : symfony-users@googlegroups.com [mailto:[EMAIL PROTECTED] > De la part de Muhammad Asif Ali > Envoyé : jeudi 3 mai 2007 10:27 > À : symfony-users > Objet : [symfony-users] Same session for All subdomains > > Hi All, > I am using wild card DNS. every register user will > get his own subdomain. The session is different for each subdmain. How can i > make the common session to all the subdomains . > > Thanks in advance :o) > > Regards > Muhammad Asif Ali --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Same session for All subdomains
Muhammad, Take a look at this post: http://groups.google.com/group/symfony-users/msg/e8b39c394458acb7 Francois _ De : symfony-users@googlegroups.com [mailto:[EMAIL PROTECTED] De la part de Muhammad Asif Ali Envoyé : jeudi 3 mai 2007 10:27 À : symfony-users Objet : [symfony-users] Same session for All subdomains Hi All, I am using wild card DNS. every register user will get his own subdomain. The session is different for each subdmain. How can i make the common session to all the subdomains . Thanks in advance :o) Regards Muhammad Asif Ali --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Same session for All subdomains
Try in your factories.yml: all: storage: class: sfSessionStorage param: session_cookie_domain: example.com Mike On May 3, 9:26 am, "Muhammad Asif Ali" <[EMAIL PROTECTED]> wrote: > Hi All, > I am using wild card DNS. every register user will > get his own subdomain. The session is different for each subdmain. How can i > make the common session to all the subdomains . > > Thanks in advance :o) > > Regards > Muhammad Asif Ali --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---