#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Posts
    1
    Rep Power
    0

    Post Automatic logins


    I am trying to create a registration/login system, and I have the individual parts working fine. Once a user is registered, I want to direct them straight to the "home" (post login) page instead of having to login in each time. The index page is a JSP page (index.jsp), and I want to forward them to home.jsp if they've already registered.

    I have been trying to use a cookie to store the information, but apparently the cookies aren't available to a JSP the first time it is displayed.

    Is there another way I should be approaching this? The only APIs I am currently using are JSP/Servlet/JDBC and would prefer to stay there (for now) if possible.
  2. #2
  3. No Profile Picture
    Java Developer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    5
    Rep Power
    0
    I don't know about JSPs not being able to read cookies the first time, but you can definitely do this with servlets instead.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Posts
    1
    Rep Power
    0
    The problem seems to have been the fact that I wasn't setting the path of the cookie. I was setting the domain and the age, but not the path. I have everything working great now.

IMN logo majestic logo threadwatch logo seochat tools logo