Click to See Complete Forum and Search --> : A question about sessions..


fatbob_51
05-02-2008, 04:27 PM
Hi!
Well I want to restrict an area of a page by using a variable and an If statment...but Im not sure if this whoudlw work, and I wanted to hear with you guys first...

You see, I have this log in panel and once you have loged in i have a Session variable that I set to true if the login succeded correctly, and false if it didnt...if it all went well I redirect my user to a controlpanel for a site. Once the user gets to the page the variable gets checked if its true or not...and if it is the panel will show up and if not the user will get redirected to a "fail" page instead..

but what Im very unsure about is if this is a good way of doing it. cause i dont know is sessions is saved in the server computer..or in the clients/users computer(as for PHP)....cause if its saved in the servers computer, that whould meen that if one user is logged in, then the restricted area whould be open for other users aswell, right?...do you get my point?

So simply what I wonder is...if one user is logged in..whould that meen that all other users that aint logged in whould get access aswell?

If there is any other smart and good way of doing a safe and easy way of restricting pages, then please let me know:)

Thanks for answers!

fatbob_51
05-02-2008, 05:25 PM
hmmm...except the above question I also wonder one more thing...how do I do a session that can be accessed at another page aswell that runned by the same server?

You see, I start a session at one page and then I redirect a user, and at the redirected page I whould like to use the session I set up in the former page again....

Do i have to configure the web.config file some how..or what am I supposed to do?

atm im setting the session with Session["var"] = "value";
and tries to get it with Session["var"].toString();

but I cant get the session for some reason....

any ideas?

A1ien51
05-04-2008, 10:58 AM
Basics on session is here:

http://www.webmonkey.com/webmonkey/03/30/index3a.html?tw=programming

Eric