You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Jon.Ridgway" <Jo...@upco.co.uk> on 2001/07/03 10:45:30 UTC

RE: question in user state management using Session

Hi Suhas,
 
You might try something like this:
 
HttpSession session = request.getSession();
 
If (session != null)
{
   id = session.getId();
}
 
Hope this helps,
 
Jon.
 
 
-----Original Message-----
From: suhas [mailto:suhas_k@techmas.hcltech.com] 
Sent: 03 July 2000 12:28
To: struts-user@jakarta.apache.org
Subject: question in user state management using Session
 
Hi 
I want to know the http request header key  -
 
I'm writing request.getSession(true)  in the jsp .  This method in turn
might be settting the browser header key .( dunno exactly name of that key)
 .But I think that header key is "set-cookie = 12313 " ( this can be the
unique
 session id that server has to set for identifying a user) .
So whenever server receives this key in the http request , server identifies
the user , if the key is present in the request
 
 Server checks the hashtable stored in the server  and retrieves the
 information for that 
 
In another jsp page I tried to print all the request header keys , But there
wasn't any such key found . ?
 
Can u tell how to check for that key 
 
 

Re: question in user state management using Session

Posted by Calvin Yu <ca...@mindspring.com>.
Try HttpServletRequest.getCookies()
 
Calvin
----- Original Message ----- 
From: suhas <ma...@techmas.hcltech.com>  
To: struts-user@jakarta.apache.org
<ma...@jakarta.apache.org>  
Sent: Tuesday, July 03, 2001 9:15 AM
Subject: Re: question in user state management using Session

Thanks Jon but I want some  more clarification .
I just want to show one of my friend that 
the browser sends the unique id back to the server .  That's the reason
I was printing the request header keys from the browser . ( It wil be
returned to the server if Server had set that using request.getSession()
method before ) .  But  printing those request parameters does not show
such key ???
How can I prove that  ??
 
Suhas 
 
 
 
 
 
 
----- Original Message ----- 
From: Jon.Ridgway <ma...@upco.co.uk>  
To: struts-user@jakarta.apache.org
<ma...@jakarta.apache.org>  
Sent: Tuesday, July 03, 2001 9:45 AM
Subject: RE: question in user state management using Session

Hi Suhas,
 
You might try something like this:
 
HttpSession session = request.getSession();
 
If (session != null)
{
   id = session.getId();
}
 
Hope this helps,
 
Jon.
 
 
-----Original Message-----
From: suhas [ mailto:suhas_k@techmas.hcltech.com
<ma...@techmas.hcltech.com> ] 
Sent: 03 July 2000 12:28
To: struts-user@jakarta.apache.org
<ma...@jakarta.apache.org> 
Subject: question in user state management using Session
 
Hi 
I want to know the http request header key  -
 
I'm writing request.getSession(true)  in the jsp .  This method in turn
might be settting the browser header key .( dunno exactly name of that
key)
 .But I think that header key is "set-cookie = 12313 " ( this can be the
unique
 session id that server has to set for identifying a user) .
So whenever server receives this key in the http request , server
identifies the user , if the key is present in the request
 
 Server checks the hashtable stored in the server  and retrieves the
 information for that 
 
In another jsp page I tried to print all the request header keys , But
there wasn't any such key found . ?
 
Can u tell how to check for that key 
 
 

Re: question in user state management using Session

Posted by suhas <su...@techmas.hcltech.com>.
Thanks Jon but I want some  more clarification .
I just want to show one of my friend that 
the browser sends the unique id back to the server .  That's the reason I was printing the request header keys from the browser . ( It wil be returned to the server if Server had set that using request.getSession() method before ) .  But  printing those request parameters does not show such key ???
How can I prove that  ??

Suhas 






  ----- Original Message ----- 
  From: Jon.Ridgway 
  To: struts-user@jakarta.apache.org 
  Sent: Tuesday, July 03, 2001 9:45 AM
  Subject: RE: question in user state management using Session


  Hi Suhas,

   

  You might try something like this:

   

  HttpSession session = request.getSession();

   

  If (session != null)

  {

     id = session.getId();

  }

   

  Hope this helps,

   

  Jon.

   

   

  -----Original Message-----
  From: suhas [mailto:suhas_k@techmas.hcltech.com] 
  Sent: 03 July 2000 12:28
  To: struts-user@jakarta.apache.org
  Subject: question in user state management using Session

   

  Hi 

  I want to know the http request header key  -

   

  I'm writing request.getSession(true)  in the jsp .  This method in turn might be settting the browser header key .( dunno exactly name of that key)
   .But I think that header key is "set-cookie = 12313 " ( this can be the unique
   session id that server has to set for identifying a user) .

  So whenever server receives this key in the http request , server identifies the user , if the key is present in the request

   

   Server checks the hashtable stored in the server  and retrieves the
   information for that 

   

  In another jsp page I tried to print all the request header keys , But there wasn't any such key found . ?

   

  Can u tell how to check for that key