Could anyone help..... I have written a simple login script that requires a username and password to be entered, this information is then passed to the main page of my application. Within the main page it connects the database and checks the username and password, if they do not match it redirects back to login page (this works fine).
The problem comes when I need to navigate back to my main page from a different page using a link. It then takes me back to my login page rather than the main page as specified in my link. I assume it is doing this because information is required to be posted from my login page to the main page? Is this the case? If so, is there anyway around it not going back to the login page each time?
Cheers
Simon
Problem with redirecting to login page
Moderator: General Moderators
Sounds like to me that you need to get this information through the login page first. I have a similar scheme that I built, and if the username and the password are not specified through the form or session state, the login information is brought up.
I would figure that you would rather have people authenticate.
--- OR ---
Are you saying that after you are passed the login page, and you are trying to use the system you are getting bounced back to the login page? If you are, then you can get around this in two ways..
1. Pass the user name and password through the forms (put them in hidden values in the page)
2. Put the information into a session. Which all information is stored on the server and is retrieved by an identifier. (more secure than 1.)
With 2 you can check the form information if nothing is present for the login, then check the session.
HTH!
Matt
I would figure that you would rather have people authenticate.
--- OR ---
Are you saying that after you are passed the login page, and you are trying to use the system you are getting bounced back to the login page? If you are, then you can get around this in two ways..
1. Pass the user name and password through the forms (put them in hidden values in the page)
2. Put the information into a session. Which all information is stored on the server and is retrieved by an identifier. (more secure than 1.)
With 2 you can check the form information if nothing is present for the login, then check the session.
HTH!
Matt