fmwebschool.com
Top Experts [learn more]Top 4-10
webko

9743 K
bandmandq

2458 K
Genx

1525 K
4. tcmeyers
5. kbata
6. Martie
7. Hammerton
8. rrenfrow
9. bneeman
10. plegler
Welcome, Guest. Please login or register.
May 22, 2013, 05:26:39 PM

Login with username, password and session length
Search:     Advanced search
FMWebschool releases more educational FMStudio webinars - check them out here:
http://www.fmwebschool.com/webinars.php
27461 Posts in 6064 Topics by 1523 Members
Latest Member: donok
* Home Help Search Calendar Login Register
+  fmwebschool.com
|-+  FMStudio
| |-+  FMStudio
| | |-+  User Login and Directory Structures
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: User Login and Directory Structures  (Read 867 times)
Hammerton
Hero Member
*****
Offline Offline

Posts: 406
Kudos: 433




Applications:
User Login and Directory Structures [Worth 50 Kudos points!]
« on: February 08, 2011, 04:15:10 PM »

I am trying unsuccessfully to create a user login based branch of my web site.

Here's what's working fine:

     Site Dir

         Connection
         FX

         index.php
         student_login.php

Here's what's not:

         teachinceassistatntdirectory

                index.php
                ta_login.php

No matter what I try, when I try to access the index page in the teaching assistant directory, it redirects to the login page. When I enter the username and password, it reloads the login page with empty uname and pword fields. That is, it doesn't go back to the index page within the teachinassistant directory. Is this a directory level issue? Anyone know how to make this work?

Thanks
« Last Edit: February 08, 2011, 04:16:49 PM by Hammerton » Logged

When the going gets weird, the weird turn pro.
webko
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2050
Kudos: 9743



WWW
Applications:
« Reply #1 on: February 08, 2011, 05:31:02 PM »

Are both using the Table Based login thingy?

There are probably conflicts in having the same session variables set in each...
Logged

tim.webko_at_gmail.com
Hammerton
Hero Member
*****
Offline Offline

Posts: 406
Kudos: 433




Applications:
« Reply #2 on: February 08, 2011, 06:08:34 PM »

Good idea. The other parts of the site use two different table based logins. But this particular problem occurs logging directly without any other active sessions.
Logged

When the going gets weird, the weird turn pro.
webko
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2050
Kudos: 9743



WWW
Applications:
« Reply #3 on: February 08, 2011, 06:40:33 PM »

OK, time for some trouble shooting...

On the login page, put

Code:
print_r($_SESSION);

To check for all the session variables...
Logged

tim.webko_at_gmail.com
Hammerton
Hero Member
*****
Offline Offline

Posts: 406
Kudos: 433




Applications:
« Reply #4 on: February 08, 2011, 08:41:43 PM »

Code:
Array ( [login_conn] => hip_ta [login_from] => /intro/intro_ta/index.php [login_type] => table [hip_ta_tableLogin] => Array ( [user] => ta4drj [pass] =>xxxxxx [first] => 1 ) )

It appears to be making a session, but regardless of where I put the login.php file, the subdirectory I want it in or the directory one up (where everything else is working) it won't return me to the index page that was originally requested. It just reloads the login page.

Logged

When the going gets weird, the weird turn pro.
Hammerton
Hero Member
*****
Offline Offline

Posts: 406
Kudos: 433




Applications:
« Reply #5 on: February 11, 2011, 07:28:51 AM »

Well I retried this with all the files at the same directory level of the stuff that works. The problem seems to be specific to userbased login. Table based login works fine.
Logged

When the going gets weird, the weird turn pro.
cooldude
Hero Member
*****
Offline Offline

Posts: 332
Kudos: 175



Applications:
« Reply #6 on: March 10, 2011, 05:05:46 PM »

maybe it's an issue with 2 logins conflicting as was stated...

does it work if you logout first then re-login?

There may be some function like structdelete? that can auto kill any previous login to put on the login page - to auto clear out any previous stuff

what would the function be for this exactly?
Logged
webko
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2050
Kudos: 9743



WWW
Applications:
« Reply #7 on: March 10, 2011, 07:08:37 PM »

I use the following to kill every session variable in one hit:

Code:
session_unset();
session_destroy();

It's my standard logout function on most systems I build
Logged

tim.webko_at_gmail.com
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!