This is a discussion on "PHP Sessions" within the PHP Forum section. This forum, and the thread "PHP Sessions are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
PHP Sessions
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
||||
|
PHP Sessions
i have two sites running on the same server, one at www.bpcu.co.uk and one in www.bpcu.co.uk/forum - however, they have different logins, and if you login to one, it completely ruins the other one because it's trying to use the other one's session variables... how can i stop this? can you restrict session variables to one folder? or something lol
any help would be much appreciated |
|
|
|
|||
|
The default session for the session.cookie_path is /, which means that they cookie issued by one application will be passed to the other. And the default cookie name is PHPSESSID which means they've both got the same name and conflict.
Both session.cookie_path and session.name can be changed in various places including your scripts (but you probably don't want to mess with those), in the php.ini file (but it will change for both applications so do you know good) on in .htaccess files .... so ... in the file $_SERVER[DOCUMENT_ROOT]/forum/.htaccess add something like php_value session.name PHPOTHERSESSNAME Well ... that's my theory. Please do let me know if it works .... P.S. Your server does need to be configured to allow .htaccess files to do this; here's hoping that yours IS, or you can change your apache config to do so. |
|
||||
|
yea i dont have access to the .htaccess files or anything like that...
but thanks neway ne other ideas?! lol |
|
|||
|
Less good (since it means changing code ...) .... try adding
|
|
|||
|
Quote:
|
![]() |
| Tags |
| php, sessions |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Little help on sessions? | ktsirig | PHP Forum | 0 | Mar 2nd, 2006 22:12 |
| Sessions | djme | PHP Forum | 4 | Feb 25th, 2006 12:10 |
| xsl, php sessions (please help) | marco_van_mayo | Other Programming Languages | 0 | Feb 19th, 2006 14:35 |
| php sessions | fragalot | PHP Forum | 7 | Nov 8th, 2005 20:43 |
| Sessions | vor | ASP.NET Forum | 3 | Aug 19th, 2003 20:10 |