Not sure if this is right, but...

You still use the HttpSession session = req.getSession(true);

This creates the session even if cookies are not available. (if it's
asking for cookies, probably something to do with your browser, check
the settings).

It's the passing of the session that is most important...
I use cookies mostly but if a client has none, then URL encoding takes
over... this is some, well just about all the code I use for URL
encoding.

try {
String target = (String)session.getValue("login.target");// marker
object
if (target != null) {
res.sendRedirect(res.encodeRedirectUrl(target));
}//end if
else {
String start = ("http://goliath.info.bt.co.uk/vdb/dblogin");
res.sendRedirect(res.encodeRedirectUrl(start));
}
}//end try

You still put the values in the session same as normal....

session.putValue("logon.isDone", user);  // just a marker object
session.putValue("login.user", user);
session.putValue("login.password", passwd);
session.putValue("login.DBownertype", DBownertype);


And retrieve them the same as well....
String user = (String)session.getValue("login.user");
String passwd= (String)session.getValue("login.password");
String DBownertype= (String)session.getValue("login.DBownertype");


I believe this is right.
Please feel free to ask any questions, simple or hard.


-----Original Message-----
From:   Sven Fuchs [mailto:[EMAIL PROTECTED]]
Sent:   Tuesday, June 08, 1999 12:41 PM
To:     [EMAIL PROTECTED]
Subject:        Session Tracking

Hello everyone.

A real newby question, I suppose. But I've searched the faqs etc. and
haven't found it.

I'd like to track sessions but avoid cookies. I've found the info,
that
getSession() determines wheater the browser can place cookies or not.
But I
don't want the user be asked for cookies ... Everything I've found
starts
with

HttpSession session = req.getSession(true);

When I write a doGet() method with nothing in except for this line and
start
it from Netscape 4.0, Netscape asks me if I want to accept a cookie.

So from where can I get a session or sessionID for rewriting URLs to
avoid
cookies?

Thanks in advance,

Sven Fuchs

_______________________________________________________________________
____
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

Reply via email to