Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

session management

Thread view: 
gandhi.pathik@gmail.com - 07 Feb 2006 04:12 GMT
Hi friends

can anyone give me idea regarding how to manage session from user's
login to signout.

also how to handle security issues.

My project is based on java, servlet , jsp and jdbc.

with thanks
pathik s gandhi
Sanjay - 07 Feb 2006 04:57 GMT
> Hi friends
>
> can anyone give me idea regarding how to manage session from user's
> login to signout.

Use HttpSession or you can also maintain your own session abstraction
through a session cookie.

Let me assume you are using Servlet

then you can write something like this

public void doGet(HttpServletRequest request, HttpServletResponse
response)
{
    HttpSession session = request.getSession(true);
    ...
    //Manage your user identity
}

or

public void doGet(...)
{
  Cookie[] cookieList = request.getCookie();
  ...//search for your cookie
  if ("MY_COOKIE_NAME".equals(cookieList[index])
  {
     //my session is present, now validate to check if this is not
timed out.
  }
}

> also how to handle security issues.

I am not sure what kind of security you are looking at, by my idea is
to use HTTP S protocol.

> My project is based on java, servlet , jsp and jdbc.
>
> with thanks
> pathik s gandhi

Sanjay
Sanjay - 07 Feb 2006 05:03 GMT
> > Hi friends
> >
[quoted text clipped - 23 lines]
>    ...//search for your cookie
>    if ("MY_COOKIE_NAME".equals(cookieList[index])

this should have been
"MY_COOKIE_NAME".equals(cookieList[index].getName())

>    {
>       //my session is present, now validate to check if this is not
[quoted text clipped - 13 lines]
>
> Sanjay
gandhi.pathik@gmail.com - 07 Feb 2006 08:02 GMT
thanks for tips

Regards,
pathik
Roedy Green - 07 Feb 2006 12:50 GMT
On 6 Feb 2006 20:12:06 -0800, "gandhi.pathik@gmail.com"
<gandhi.pathik@gmail.com> wrote, quoted or indirectly quoted someone
who said :

>can anyone give me idea regarding how to manage session from user's
>login to signout.
>
>also how to handle security issues.
>
>My project is based on java, servlet , jsp and jdbc.

I am digging into that myself.  I have documented what I have found so
far at http://mindprod.com/jgloss/passwords.html
and http://mindprod.com/jgloss/authentication.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.