You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by hitthu indra <hi...@yahoo.co.in> on 2013/05/27 13:04:43 UTC
[users@httpd] unable to get username with AuthFormLoginRequiredLocation
Hi all,
I have a login page which accepts username and password.
Once the user clicks on login button, control goes to the action (/l_security_check).
This username and pw are authenticated using form based
auth. IF the login is success, it invokes the URL specified under AuthFormLoginSuccessLocation.
If login is successful, Login.php page retrieves the
lsession cookie (specified under SessionCookieName) and writes the username it
to the log.
If the login fails , it invokes the URL specified under AuthFormLoginRequiredLocation.
In case of login failure, lsession cookie is coming as empty. Because of which
we are not able to log the username.
Both Login.php and loginError.php has the following code to
retrieve the lsession attribute specified under SessionCookieName
$_COOKIE ['lsession'];
à
This is coming properly in Login.php, but it is coming empty in loginError.php.
Any help on this would be appreciated.
Index.html :
<form method="POST" name="LoginForm"
action="/l_security_check">
<input
type="text" name="j_username">
<input
type="password" name="j_password">
l_security_check is defined in the httpd conf file as
follows
<Location "/l_security_check">
AuthType form
AuthName "Form-based auth"
AuthFormProvider external
AuthExternal pwauth
SetHandler form-login-handler
AuthFormUsername j_username
AuthFormPassword j_password
AuthFormLoginRequiredLocation
https://10.63.70.186:443/loginError.php
AuthFormLoginSuccessLocation
https://10.63.70.186:443/Login.php
AuthFormAuthoritative off
Require valid-user
Session On
SessionCookieName lsession path=/
</Location>
ThanksHithendra