[Logo]
Forums Register Login
knowing the clients supports cookies or not.
Can any one tell me, how can i know whether the client supports cookies or not not before instantiating a session.
Hi Lokesh,
How are things at WebVeda. Any how with respect to your query i think that you have to send a cookie to the client and then invoke another servlet which tries to retrieve the cookie. If the cookie is retreived by this servlet then cookies work else they don't. I will check up further if you really need it.
check out things here http://www.jguru.com/jguru/faq/view.jsp?EID=152
Regds
Rahul P. Mahindrakar
[This message has been edited by Rahul Mahindrakar (edited January 24, 2001).]
Hi rahul sir,
I have done the same thing, but is there any way without doing all these things.
I have done in another way as follows.
HttpSession session=req.getSession(true);
if(req.isRequestedSessionIdFromCookie())
{
out.println("Cookies accepted");
}
else
{
out.println("Cookies rejected");
}
but i dint want to instantiate the HttpSession also.
I hope u can find a solution for this.
Bye.
With regards.
Loke.

[This message has been edited by lokesh reddy (edited January 24, 2001).]
why cant you just do this?
private Cookie[] cookies = request.getCookies();
if (cookies != null) {
Hi Randall,
This again would return array of cookies which are already stored on the client side. But say this is the first time my server has been accessed by the client then whats the solution as this method would return null though Cookies may be supported.
Hope i am right in my question.
Thanks
MKBala.
Hi Randall,
This again would return array of cookies which are already stored on the client side. But say this is the first time my server has been accessed by the client then whats the solution as this method would return null though Cookies may be supported.
Hope i am right in my question.
Thanks
MKBala.
Hi,
Would HttpSessions method
public boolean isNew()
useful to determine if the client supports cookie or not. Pls clarify...
Thanks
MKBala.
I promise I will be the best, most loyal friend ever! All for this tiny ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature


This thread has been viewed 491 times.

All times above are in ranch (not your local) time.
The current ranch time is
Apr 20, 2018 06:58:30.