Recently Browsing 0 members
No registered users viewing this page.
By Martin Muzatko
I want to create a user front-end (user can register/login/logout via templates)
I'm working based on the intermediate site profile. So _init.php is loaded first, then the template file and then _main.php.
I integrated the custom login as described here, and changed it to my needs. ( I don't want to redirect the user, if the form is filled in successfully)
The problem I face, is that $user->isLoggedin() lags behind $session->login().
Which means that whenever I do a login, I DO get the information that the login was successful ($session->login(...) instanceof User). I COULD use that information on _main.php to show a profile in the upper right corner.
However I don't want to set a variable in the template and ask for it in _main.php. Are there any alternatives? Is a redirect really required to complete the session handling? Why? I have the same problem for the logout. The user is still displayed as logged in, when he opens the logout page.
Thanks in advance.
How to track user active time based on session login and logout.
Basically, I want to get the report that each user login time and logout time/session inactivity time.
Is there any module available or we can use any hooks to simulate the above.
Thanks in advance for your support.
Hi all. Perhaps this is just my fault, but I can't get behind it :-(
When I store an array in a $session and want to read its contents – after a $session->redirect() – it is NULL by var_dump()
If I use the exact same code and just store a string or a Page ID the output is correct.
// file-1, product page $last_add_to_cart['product'] = $selected_product; $last_add_to_cart['quantity'] = $selected_product_quantity; $session->last_add_to_cart = $last_add_to_cart; $session->redirect('/warenkorb/'); // file-2, cart var_dump($session->last_add_to_cart); // is NULL Strangely this works
// file-1, product page $last_add_to_cart['product'] = $selected_product->id; #$last_add_to_cart['quantity'] = $selected_product_quantity; $session->last_add_to_cart = $last_add_to_cart; $session->redirect('/warenkorb/'); // file-2, cart var_dump($session->last_add_to_cart); // is 1234 EDIT: When I var_dump the $session before the redirect everything is ok