CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 1999
    Posts
    4

    Posting a cookie from a servlet

    Hello

    It is a bit complicated to explain
    I am trying my best to do it
    ------------------------------------------------------------------------------------------------------------
    I am using a cookie to store data regarding a user.This cookie is set by a servlet after verifying the userid and the corresponding password.This servlet then generates an html page .If I exit from this page by deleting the cookie and then come to this page by clicking on the back button of the browser if I click the refresh button the servlet is called again and the cookie is set again which I don't want as the user has
    already exited

    I want to distinguish in the servlet wether the servlet is being called by the by clicking the Refresh button of the browser or from the Logon Page.
    Can it be done

    Arnab




  2. #2
    Guest

    Re: Posting a cookie from a servlet

    Hai,
    Here you have to use HttpSession.When the user first visits the webpage try to create a session if the req.getSession('false') ; return null sothat it will create a new session.When the user next comes to this page ,the same function returns the current session and it doesn't return null value.If this function returns null,then only create Cookie object.I think,you can solve this problem by using sessions.
    Bye.
    DHANUJ.





Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured