Need help modifying the default login forms
Using Security Assist 1.1.9 (I have the whole "super suite" of WA tools)
FYI, in this post I use the term "redirect" loosely because I don't know the exact technical definition of "redirect".
For my site I generated a complete set of registration and log in forms using the SecurityAssist series of tutorials (securityassist/ "Introduction to SecurityAssist"
01_overview.swf and so on)
During initial user testing, I'm getting reports from the users that they are having a difficult time with the registration and login screens. I need to change some things but I'm not sure how to do it, so let me describe the problems and what I need - and maybe someone can offer a solution.
The way the my site is setup now, when a user tries to add an item to the cart, they are immediately forced to login (the viewcart page has the login page rule restriction enabled). (For reasons that I won't get into right here, I really do need them to log in before they view the cart.) If they ALREADY have an account, they log in and are sent to the viewcart page, and everything is perfect.
However, if they must register because they DON'T already have an account, what ends up happening is this:
1) Customer clicks add to cart
2) Customer sees "Log in or Register" screen, where they click the link to the registration form (I added this link myself, it's just an regular HTML text link)
3) Customer fills out registration form and clicks submit
4) Customer is sent BACK to the login form, apparently because registering does not simultaneously log them in and also because possibly the "insert record" server behavior (a DataAssist behavior) is set to redirect to the login screen
5) Customer submits the login form, and is then sent to the "edit profile" page, instead of viewcart.php.
Usually by this time the new user is terribly confused and wants to leave the site :-(
So in other words, if they already have an account, they log in and are correctly sent (redirected?) to the view cart page, but if they have to register for a new account, the requested destination page (viewport) & redirect gets "lost" and the user ends up being sent to the profile page, instead of the viewcart page. I assume this is because the default action of the login form is to redirect to the profile page, IF the login form was called directly (and somehow by the time we get back around to it, it no longer knows that the user was headed for the viewcart page).
I think there's 2 essential technical problems: First, somewhere during the registration process, the redirect gets lost. Is there some recommended way to preserve that? In other words, I need the registration page to redirect to the original destination page like the login form does, except that somehow the destination page needs to be preserved through several pages (instead of just one).
Second - is there someway to log the user in when they register WITHOUT sending them to the login screen? In other words, make it so that filling out and submitting the registration form logs them in as well as creates their account. My understanding is that the login screen essentially sets several session variables, and once those are set, that's the definition of"logged in". Is that a correct understanding/assessment, or does something else happen during login?
I have another problem with detecting incorrect email addresses, but I'll post about that in another thread.