Why don't I receive new comments to my e-mail?
Header, Directory, and SESSIONs
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > PHP web-programming > Header, Directory, and SESSIONs 22 June 2003 09:31:56

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

Header, Directory, and SESSIONs

Nabil 22 June 2003 09:31:56
 Hi all, wish u all a good weekend..
Guys I have a question as the following:

1- In my wwwroot I have two folders : folder1 and folder2 (actually I have
14 folders)
2- In the same two folders there are same PHP files do the same job, as db
jobs with different databases..
3- I log in the users by register a session, lab lab lab ... etc
4- the logging files in the two folders are different by registering a
different session value.
4- I want if any user jumped to the other directory and logged in with the
correct requested password TO HAVE THE FIRST SESSION UNREGISTERED
automatically, so he can't be logged in in both at same time.. and keep only
the new.. and ofcourse have to re logging if he jumped back to the first
one...
(the reason that every folder has different DB connection, and the
interface of the two section are identical.. so I need to split it .to avoid
any problems with many users ....)

5- what I m trying to do is , if there is a possibility to control the
header.. by if { /folder1 go } else { unregister session whatever}
if {/ folder2 .............. } else {.........} etc

6- IS IT A GOOD WAY TO DO IT , OR NOT? of cource I need a security in the
first place..

I HOPE I WAS CLEAR, and thanks for your patient again... :)­
(sorry because it might be shouldn't in db list)
Regards
Nabil

----------
""open source world, open mind for all""



--
PHP Database Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


Add comment
Nabil 21 June 2003 09:43:14 permanent link ]
 Hi all, wish u all a good weekend..
Guys I have a question as the following:

1- In my wwwroot I have two folders : folder1 and folder2 (actually I have
14 folders)
2- In the same two folders there are same PHP files do the same job, as db
jobs with different databases..
3- I log in the users by register a session, lab lab lab ... etc
4- the logging files in the two folders are different by registering a
different session value.
4- I want if any user jumped to the other directory and logged in with the
correct requested password TO HAVE THE FIRST SESSION UNREGISTERED
automatically, so he can't be logged in in both at same time.. and keep only
the new.. and ofcourse have to re logging if he jumped back to the first
one...
(the reason that every folder has different DB connection, and the
interface of the two section are identical.. so I need to split it .to avoid
any problems with many users ....)

5- what I m trying to do is , if there is a possibility to control the
header.. by if { /folder1 go } else { unregister session whatever}
if {/ folder2 .............. } else {.........} etc

6- IS IT A GOOD WAY TO DO IT , OR NOT? of cource I need a security in the
first place..

I HOPE I WAS CLEAR, and thanks for your patient again... :)­
Regards
Nabil



--
PHP General Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


Add comment
Nabil 21 June 2003 09:43:14 permanent link ]
 Hi all, wish u all a good weekend..
Guys I have a question as the following:

1- In my wwwroot I have two folders : folder1 and folder2 (actually I have
14 folders)
2- In the same two folders there are same PHP files do the same job, as db
jobs with different databases..
3- I log in the users by register a session, lab lab lab ... etc
4- the logging files in the two folders are different by registering a
different session value.
4- I want if any user jumped to the other directory and logged in with the
correct requested password TO HAVE THE FIRST SESSION UNREGISTERED
automatically, so he can't be logged in in both at same time.. and keep only
the new.. and ofcourse have to re logging if he jumped back to the first
one...
(the reason that every folder has different DB connection, and the
interface of the two section are identical.. so I need to split it .to avoid
any problems with many users ....)

5- what I m trying to do is , if there is a possibility to control the
header.. by if { /folder1 go } else { unregister session whatever}
if {/ folder2 .............. } else {.........} etc

6- IS IT A GOOD WAY TO DO IT , OR NOT? of cource I need a security in the
first place..

I HOPE I WAS CLEAR, and thanks for your patient again... :)­
Regards
Nabil



--
PHP General Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


Add comment
Andrew Warner 22 June 2003 00:25:04 permanent link ]
 At 9:43 AM +0300 6/21/03, nabil wrote:>4- I want if any user jumped to the other directory and logged in with the>correct requested password TO HAVE THE FIRST SESSION UNREGISTERED>automa­tically, so he can't be logged in in both at same time.. and keep only>the new.. and ofcourse have to re logging if he jumped back to the first>one...


If the user has the credentials to access both directories, why not
let him be logged into both directories, provided he logs into both
separately?
You can confine cookie containing session id to the site _and_
directory user logged into so that you have have separate sessions
for both:

in your login routine in each directory:

session_set_cookie_­params (0, dirname($_SERVER['SCRIPT_NAME']).'­/');
session_start();

Now when user logs into different directory, php won't even know
about session cookie from other directory. This is my understanding,
anyway.

andrew



--
PHP General Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


Add comment
Nabil 22 June 2003 09:31:56 permanent link ]
 As I said before that I don't want the same user to confuse in which part of
the site he is ... because as I said it is same PHP files but dealing with
different databases and tables.. so I can't let him jump in between , and
cause some confusion and data mess when he's entering data..

PLEASE COMMENTS

"Andrew Warner" <awarner@calendarse­rve.com> wrote in message
news:a05210601bb1a7­9950205@[10.0.1.7]...> At 9:43 AM +0300 6/21/03, nabil wrote:> >4- I want if any user jumped to the other directory and logged in with
correct requested password TO HAVE THE FIRST SESSION UNREGISTERED> >automatically, so he can't be logged in in both at same time.. and keep
only> >the new.. and ofcourse have to re logging if he jumped back to the first> >one...>
If the user has the credentials to access both directories, why not> let him be logged into both directories, provided he logs into both> separately?> You can confine cookie containing session id to the site _and_> directory user logged into so that you have have separate sessions> for both:>
in your login routine in each directory:>
session_set_cookie_­params (0, dirname($_SERVER['SCRIPT_NAME']).'­/');> session_start();>
Now when user logs into different directory, php won't even know> about session cookie from other directory. This is my understanding,> anyway.>
andrew>



--
PHP General Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


Add comment
Cristian MARIN 23 June 2003 20:40:18 permanent link ]
 What don't you use a session var like $HTTP_SESSION_VARS['folder'] =
'folder1' or = 'folder2'. If the user switch the directories after the login
you verify if the $HTTP_SESSION_VARS['folder'] is good for any of the two
session, if not session_destroy() and go to the login page. You may do that
by creating a new file 'verifyFolder.php':­

<?php
session_start();
if (isset($HTTP_SESSIO­N_VARS['folder']) && $HTTP_SESSION_VARS['folder']
!= 'folder1' && $Username ...){
session_destroy();
header('Location:lo­gin.php')
}
?>

and to any file in the folder add in the first line

<?php
require_once('verif­yFolder.php');
?>

it's easiear this way to verify the rights in one file and include him to
all other. This way you are sure the session is starting and the code is
easiear to debug
--
-------------------­--------------------­----------
Cristian MARIN - Developer
InterAKT Online (www.interakt.ro)
Tel: +4021 312.53.12
Tel/Fax: +4021 312.51.91
cristic@interakt.ro­
"Nabil" <nabil.attar@aws-sy­ria.com> wrote in message
news:20030621085529­.49816.qmail@pb1.pai­r.com...> Hi all, wish u all a good weekend..> Guys I have a question as the following:>
1- In my wwwroot I have two folders : folder1 and folder2 (actually I
have> 14 folders)> 2- In the same two folders there are same PHP files do the same job, as db> jobs with different databases..> 3- I log in the users by register a session, lab lab lab ... etc> 4- the logging files in the two folders are different by registering a> different session value.> 4- I want if any user jumped to the other directory and logged in with the> correct requested password TO HAVE THE FIRST SESSION UNREGISTERED> automatically, so he can't be logged in in both at same time.. and keep
only> the new.. and ofcourse have to re logging if he jumped back to the first> one...> (the reason that every folder has different DB connection, and the> interface of the two section are identical.. so I need to split it .to
avoid> any problems with many users ....)>
5- what I m trying to do is , if there is a possibility to control the> header.. by if { /folder1 go } else { unregister session whatever}> if {/ folder2 .............. } else {.........} etc>
6- IS IT A GOOD WAY TO DO IT , OR NOT? of cource I need a security in the> first place..>
I HOPE I WAS CLEAR, and thanks for your patient again... :)­> (sorry because it might be shouldn't in db list)> Regards> Nabil>
----------> ""open source world, open mind for all"">



--
PHP Database Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > PHP web-programming > Header, Directory, and SESSIONs 22 June 2003 09:31:56

see also:
Reading tab delimited File & sort…
can i do it with perl ?
Slices
пройди тесты:
see also:
craig fox '3xp10i73r' the computer…
E-Cracker 10.0 ***Finally Released!***
E-Cracker 11.0 pro edition ||||||||…

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .