amrita singhal wrote:means
Try putting as much effort into your posts as you would like to see in the responses.
Your habit of making single-word and incomplete-sentence posts does not make people want to spend their volunteer time to help you if you won't even take the time to form complete sentences.
A cookie can only have a single value, and as mentioned, needs a round-trip.
If you're trying to keep user-specific objects, keep them in the session.
I'd really recommend getting familiar with how HTTP, web applications, etc. work before trying to go much further, and Bear is correct-it's a good idea to really make sure your messages are as clear and concise as possible, but not so concise that they sound dismissive, or trivialize the amount of time people are putting in to helping you. Thanks!
Cookie ck2=new Cookie("cookiee",s3);
now when i get the value from cookie it does not give all values of users that are signed up
this is the problem'
can anyone give me the solution?
thankx in advance
i want to create it for change password coding
if anyone use my username and get password from change password link then he will be able to see my profile
i want to remove it
so i create coookie
when person gets login with my username/password at another machine ,then he would be not eligible
so can anyone solve me this problem
How might you implement that?
David Newton wrote:Maybe try listing specifically the steps you think you'd need to take in order to implement this--think through the problem, post your potential solutions, we can take it from there. You already know that you want a cookie (probably set on login and removed on logout) and that you need to track those on the server side.
How might you implement that?
But you didn't do what I asked, which is to write down the exact steps, in English (NOT code), that you'd need to take in order to solve this problem.
2. in regis.jsp database insertion takes place
3. in regis.jsp i also create cookie when i store that people user name
4. in login.jsp when person click on change password link it must be cheked that the people user name is available in cookies or not
5. if not means that people has fake login
problem is that all people that are signed up has username values and that values must be stored in cookies
while it stores only latest person usermname
The next step in solving your problem is deciding how to use that list of currently logged in users. (You'll also need to remove users from that list if they log out or if that session expires.)
Since you're specifically trying to exclude the same user ID from logging in from a different *machine* at the same time they're already logged in, your problem is actually more complicated than you might have thought at first--what if I try to log in using a different browser on the *same* machine? We'll cross that bridge later. (It's also not clear how you'll handle a case when the user has cookies turned off--also a task for another time.)
So when a user logs in, you'll give them a cookie, and mark them as being logged in by storing their user ID in the "logged in list". What's next?
1) What's your definition of a cookie?
2) Where does cookie data reside?
3) What kind of data can a cookie hold?
Here's the solution I think you're trying to use:
1 User logs in
1.1 Store user name on server side
1.2 Give user a cookie saying they're logged in
2 Another user logs in
2.1 Is that user already logged in?
2.2 If yes, signal error
2.3 If no, continue normally
3 User logs out
3.1 Remove their name from the list of logged in users
Is that correct, more or less? If so, which specific part are you having a problem with? If not, tell me what your ideas are, and we'll go from there.
(Noting that there are still a couple of issues with this solution that are probably not worth solving, given the nature of web applications and how HTTP works.)