Reply to Re: sessions and domain names

Your name:

Reply:


Posted by Kimmo Laine on 10/27/06 09:18

"magic_hat60622" <magic_hat60622@yahoo.com> wrote in message
news:1161906844.922031.88670@i3g2000cwc.googlegroups.com...
> Hi all. I've got an app that dumps a user id into a session after
> successful login. the login page is http://www.mydomain.com/login.php.
>
> If the user visits pages on my site without the www (i.e.,
> http://mydomain.com/foo.php), the session works fine and login state is
> maintained.
>
> If he visits http://www.mydomain.com/foo.php, the app drops the
> logged-in state.
>
> Any idea how to fix this? I'm running php 4.4.1 w/ linux apache.


Sessions are per domain. For www.mydomain.com there is one session, and for
mydomain.com there is another. Redirect all users from www.mydomain.com to
mydomain.com or vice versa. Make sure the domain is always the same. so that
it doesn't change on the way. That way they will always use the same
session.

--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti p�ivittyv� nettisarjis
spam@outolempi.net | rot13(xvzzb@bhgbyrzcv.arg)

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация