Results 1 to 2 of 2

Thread: sessions doubt

  1. #1
    anilarava is offline Member
    Join Date
    Nov 2010
    Posts
    1
    Rep Power
    0

    Default sessions doubt

    i opened one browser and typed one jsp page in the one form is there in that one only username is there i typed that username and clik on submit and navigate to another page
    <HTML>
    <BODY>
    <FORM METHOD=POST ACTION="SaveName.jsp">
    What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20>
    <P><INPUT TYPE=SUBMIT>
    </FORM>
    </BODY>
    </HTML>


    SaveName.jsp :


    <%
    String name = request.getParameter( "username" );
    session.setAttribute( "theName", name );
    %>
    <HTML>
    <BODY>
    <A HREF="NextPage.jsp">Continue</A>
    </BODY>
    </HTML>



    NextPage.jsp shows how to retrieve the saved name.

    <HTML>
    <BODY>
    Hello, <%= session.getAttribute( "theName" ) %>
    </BODY>
    </HTML>

    here my doubt is i opened another browser and getting the same user is it possible

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,802
    Rep Power
    19

    Default

    If you open two browsers (both the same browser, that is both IE or both Firefox) on the same machine they will have the same session id, since they will be looking at the same cookie.

Similar Threads

  1. Kill sessions
    By Subscribe.name in forum Java Servlet
    Replies: 1
    Last Post: 10-05-2009, 10:22 PM
  2. problem with sessions
    By lisa.lipsky in forum JavaServer Pages (JSP) and JSTL
    Replies: 6
    Last Post: 09-09-2009, 01:46 AM
  3. Http Sessions
    By manasa in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 03-29-2008, 10:51 AM
  4. Sessions in jsp
    By Ed in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 07-02-2007, 03:46 PM
  5. sessions in jsp
    By Heather in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 06-30-2007, 03:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •