Click to See Complete Forum and Search --> : oh my, i'm session dummy, SOS!!!!


simbako
08-10-2006, 10:33 PM
:confused:
i am making a page that has two level of admin. problem is, the sessions for both of them share same characteristics and values, thus it seems that they overwrite each other. :(

i've tried reading how to use session_name and the PHPSESSID but i can't really understand them... :confused:

problem is, when i log-in as admin2, i can see pages for admin1 though i can't really do things there, the page with no functionalities will appear. but it still shows. also, when i log-in to admin1 and then i log-in to admin2 in another page, the session for admin1 will be overwrited...
:eek:


:)
how do you make two separate sessions? how do you access the other session from the other?

shane.carr
08-11-2006, 01:55 AM
I don't think that you can have two sessions forr the same directory. Why don't you store your data in different keys so they don't overwrite each other?

$_SESSION['myvalue_a'] = "a"; //for page a
$_SESSION['myvalue_b'] = "b"; //for page b

simbako
08-11-2006, 02:00 AM
my fault, hehehe! :D what i mean by pages are different web pages, they are not related. like the log-in for one are just student level so they have different pages installed for them, the other one is teacher access and they have different pages also, but the problem is, when i log-in as teacher, i can access the pages for the students...

shane.carr
08-11-2006, 02:11 AM
Two different pages or two different sites? my method will work if they're two dfiferent pages, and two different sites wouldn't even have the problem.

two different:

pages: example.com/this.php : example.com/that.php

sites: example.com/this.php : domain.com/that.php