What Geeta said I agree with her too. Or u can put ur code in service method
directly. so u don't have worry about the get and post of method. I think
must work. Because I tried in my application.
And remmember to check the username with the old username value if both are
different update the the username in cookie or seeion
Will this could help u out
Vishal
-----Original Message-----
From: Geeta Ramani [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 17, 2000 2:25 PM
To: [EMAIL PROTECTED]
Subject: Re: Problem using Cookie and Session Variables
Shrikant:
Since you have not included any code, I am only guessing at a possible
reason
for this (apologies in advance if I say something very obvious): Have you
put
the code for setting the cookies in the init() method? Because that method
gets
executed exactly once (when your validation class is loaded), so any cookies
set here will not be updated till you, say, restart the server and force a
re-load. If you put the code for setting the cookies in the doPost method,
then
this code will be executed every time the login form is submitted and so you
should be ok.
Hope this helps!
Geeta
Shrikant Amale wrote:
> Hi all Servleters,
>
> I am new to Cookies and Session Variables,
> i am facing a problem using both. I have created
> a logon screen i am accepting username and password
> from it. when submitted i am storing username in a
> cookie after validation, I am reading value of cookie
> from another servlet (it works fine for first time),
> but when i go to previous page I change username, the
> servlet for validation gets called on submitting and
> it stores the value of username into cookie, but this
> time i get the old value from the cookie when i read
> it from the other servlet.
> I tried the same with Session Variables and I am
> getting always the old value.
>
> What can be the problem?
>
> Please help me. if possible provide code also.
>
> Thank you in advance
>
> Shrikant
>
> __________________________________________________
> Do You Yahoo!?
> Get Yahoo! Mail - Free email you can access from anywhere!
> http://mail.yahoo.com/
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html