In the above example if the cookies are disabled then the program will always written new session. But I've tried this program after disabling the cookies but it writtens welcome back when I refresh the window.How is it possible?
Amirr Rafique
Ranch Hand
Joined: Nov 14, 2005
Posts: 323
posted
0
If cookies are disabled then container will automatically fall back for URL rewriting for session management.
Hope it helps
"Know where to find the solution and how to use it - that's the secret of success."
Nikhil Jain
Ranch Hand
Joined: May 15, 2005
Posts: 383
posted
0
Yes, the container will fall back to URL Writing, but this is only if we write the code for it..
SCJP 1.4, SCWCD 1.4, SCBCD 1.5
Steve Jerome
Greenhorn
Joined: Mar 03, 2007
Posts: 22
posted
0
But I didn't write any code for URL rewriting.Can anyone try this program and tell what happens.
Shrenik Sakriya
Ranch Hand
Joined: May 07, 2001
Posts: 40
posted
0
As far as i know the server first tries to use Cookie by default as a session tracking mechanism, if the cookies are disabled then it uses URL Rewriting by default. Hence in your case the session is still active.
Shrenik Sakriya
SCJP1.2 88%<br />SCWCD1.4 89%<br />CCNA 94%
Steve Jerome
Greenhorn
Joined: Mar 03, 2007
Posts: 22
posted
0
yeah that's right only if you use URL rewriting in your code.but I didn't use URL rewritig as I said before.
Your code works fine in my case, i.e. it only shows "new session" when refreshing the page and cookies are disabled (I'm using Firefox). Are you sure cookies are disabled in your browser? (just checking) [ March 23, 2007: Message edited by: Johan Pelgrim ]
Johan Pelgrim, The Netherlands
SCJP 1.4, SCWCD 1.4, SCBCD 5.0
warren li
Ranch Hand
Joined: May 23, 2006
Posts: 128
posted
0
Originally posted by Shrenik Sakriya: As far as i know the server first tries to use Cookie by default as a session tracking mechanism, if the cookies are disabled then it uses URL Rewriting by default. Hence in your case the session is still active.
Shrenik Sakriya
No. the server will use both at the first response if you did use URL rewriting in your code. if cookie is enabled, then subsequent responses will ignore URL rewriting in your code. otherwise, they will use URL rewriting.
Think about it. If hte server only uses cookie as default on the first response, what if the cookie is disabled by the user? then the next request comes in without any session id information, then the server will have to create a new session. This is certainly not what we want.
Try flushing your cookies and then doing a refresh.
IE-Internet Explorer.I've already tried deleting the cookies but no use.can anyone able to run the program in internet explorer?
Sunder Ganapathy
Ranch Hand
Joined: Apr 01, 2003
Posts: 120
posted
0
I ran the program on IE 6. No problem faced. I kept 'Medium High' in the Privacy tab of Tools/Internet Options.
First time you get new session and when you refresh you get welcome back.
Steve Jerome
Greenhorn
Joined: Mar 03, 2007
Posts: 22
posted
0
Originally posted by Sunder Ganapathy: First time you get new session and when you refresh you get welcome back.
Actually the program runs fine and the output is what you are getting with cookies enabled.But the problem is running the program after disabling cookies(Read the first Question of the forum).When you disable cookies you should get only new session every time you refersh the browser.But instead welcome back is printing.
Clifton Eaton
Greenhorn
Joined: Mar 26, 2007
Posts: 16
posted
0
Apparently the difficulty you are having in IE is due to the way IE treats the localhost domain. I was able to repeat your problem and after some research uncovered this article: