Re: Verifying AUthorised Users through Session Variables not Working...?

From: Date: Tue, 27 Jul 2004 22:26:12 +0000
Subject: Re: Verifying AUthorised Users through Session Variables not Working...?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-192042@lists.php.net to get a copy of this message
On Tue, 27 Jul 2004 23:21:34 +0100, Harlequin <michael.mason@arraspeople.co.uk> wrote: > Hi all. > > I'm using session variables to identify if a user is authorised, if yes - > display x and so on. > > However, I've come across a couple of issues: > > when users access a page that's 2 folders deep into the root I.e. > www.mydomain.com/folder1/folder2 any include references I use have to be > absolute instead of relative, has anyone else come across this...? > Relative includes are relative to the "starting" script's location. So if you have config.php in folder1 and you're accessing folder2, you have to use ../config.php. One way to get around this is to have all includes in a central place and add it to your include_path (This is what I do). I do it through ini_set, but you could do it through a .htaccess file or the php.ini much easier. > Also: users are not being authorised even though there's a variable that > says they are. I have verified this by placing a file in folder1 and it > displays fine but if I click a link to access a file in foder2 I get a login > page - I shouldn't. Any ideas...? I assume you're calling session_start() in *all* of these pages? Sessions *will* work across all folders on your website. Or at least they should. You're not changing domains, right? Like from without www. to with www.? > > -- > ----------------------------- > Michael Mason > Arras People > www.arraspeople.co.uk > ----------------------------- > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > !DSPAM:4106d348216571949498371! > > -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin--

« previous php.general (#192042) next »