This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Get Programming with Java (MEAP only) and have Peggy Fisher on-line!
See this thread for details.
Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Jforum SSO - restrict direct forum access => redirect to login page if not loged in please help!!!  RSS feed

Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem, if user tries to access the jforum directly without logging in then system should intercept, check if the session is active, if not then divert him/her to a login page, but mine isn't working that way, please help!!!

i use tomcat and my application is in the ROOT ( http://localhost:8080/ )
the jforum is installed in ( http://localhost:8080/jforum )

my cookie stores the username and if anyone is registered to my application and logs in then when he/she clicks on the forum link on my application it will check for the cookie and the username with the applications database and flys to jforum if the username doesn't exist the jforum is creating it its all fine

but now the problem is if the user is not loged in my application and bookmarks any page of the forum when he/she clicks on the bookmark it redirects directly to the forum desired page as an Anonymous user if he/she is not logged in right???, but i want it to check if the user is logged in to my application first (checking for the cookie and then checking the username from the cookie with the database) if the user is signed in then should display the desired page but if not it must be redirected to the login page.

please anyone help me with this i will be very grateful.

this is my SSO Cookie class

this is my global configuration file

this is how i create the cookie

please help thank you so much great forum!!!
[originally posted on by zzaamine]
Migrated From
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't want to allow users to browse the forum without being logged, an easy approach is to force a redirect from the html page. Open the file templates/default/header.htm, and there put a code like

[originally posted on by Rafael Steil]
Let's get him boys! We'll make him read this tiny ad!
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!