Forum Moderators: phranque

Message Too Old, No Replies

Redirecting first time users to login page

Apache/php

         

rajkpy01

7:50 pm on May 2, 2009 (gmt 0)

10+ Year Member



Hi experts,
I have a application which consists of a login page and other application specific php file.
At present the users are able to access the application files directly through the url.

Now I want to have an access control feature implemented by which when a user first tries to access the files directly through url, they are redirected to the login.php page. and once the user is able to login successfully they are then redirected to the file requested previously and now he can access any of the application files by directly mentioning the url.

Now since I have about 1000 application specific file, please
let me know how i can implement this access control feature. As i dont want to including any session specific feature in all the 1000 files, it would be great if I have a centralized way of doing this.

Thanks in advance.

g1smd

7:57 pm on May 2, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'd assume some method using cookies here.

How do people sign up? Is this open to anyone signing up, or is the list fixed and pre-determined?

rajkpy01

8:05 pm on May 2, 2009 (gmt 0)

10+ Year Member



Hi g1smd,
The list is pre-determined.

Thanks

jdMorgan

10:27 pm on May 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A classic job for cookies... Set a cookie on log-in. Always check for the cookie. If the cookie isn't present, redirect the visitor to the login page.

The easiest place to set and check cookies is in your script. If that's not feasible, then Apache 1.3x can check cookies in .htaccess and Apache 2.x can both set and check cookies in .htaccess (using mod_rewrite).

Jim