Topic-icon Check if user session is active

Active Subscriptions:

None
13 years 3 months ago #31410 by andbal2
Hi, i used Joomla and JFBConnect to develop Facebook Application. I need to define access to application in this 3 cases:
1. new users click facebook login (a page without menu or other links) to confirm data and using jfbconnect redirect to a page with menu (home) OK
2. users registered and not connected (like point 1) OK
3. for users registered and already connected i have an issue because there isn't a redirect and in same time they don't have menu or other link. for this reason would be great have a checking if user is connected and just in this case redirect to home

tx, best regards
The topic has been locked.
Support Specialist
13 years 3 months ago #31417 by alzander
Just to make sure, #1 and #2 are covered. You just need help with #3?

Regarding #3, how are the user's "registered and connected"? When they get to that landing page, how are they already logged in that didn't perform a redirect? I guess I'm not understanding the issue very well. JFBConnect will always redirect the user when the login, whether it's with the button or with the auto-login feature. So, if they're redirected, how do they get to that page?

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
13 years 3 months ago #31421 by andbal2
Yes, i need help on the 3 point. this is the case when a user visit application for second time during the same joomla session. for my application joomla session time is 2 hours, it's not short time so it happens
The topic has been locked.
Support Specialist
13 years 3 months ago #31433 by alzander
That's not something we'd implement in JFBConnect. Since you're basically just looking to redirect users that are logged into your site (whether through Facebook/JFBConnect or Joomla) to a new page, it's really not a JFBConnect-specific issue.

I'm not sure if there are plugins out there that do this already. If not, the only code you'd need is:
if (!JFactory::getUser->guest)
   JFactory::getApplication->redirect('index.php?option=.....');
You could use a custom PHP module for that, like Flexi Custom Code

Hope that helps,
Alex
The topic has been locked.