cookie session
来源:互联网 发布:淘宝众筹怎么推广 编辑:程序博客网 时间:2024/05/16 16:55
URL重写加上sessionId 小心cookie禁掉,session应用不能用,
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.net.*;
import java.util.*;
//Session追踪
public class URLSession extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
HttpSession session = request.getSession(true);
out.println("<html><head><title>Session追踪</title></head>"
+ "<BODY>\n"
+ "session id:" + session.getId() + "<br>"
+ "from url:" + request.isRequestedSessionIdFromURL() + "<br>"
+ "from cookie:" + request.isRequestedSessionIdFromCookie() + "<br>"
//
+ "<a href=" + request.getRequestURL().toString() + ">test</a>"
+ "<a href=" + response.encodeURL(request.getRequestURL().toString()) + ">test</a>"
+ "</BODY></HTML>");
}
/** Handle GET and POST requests identically. */
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
}
- Session,Cookie
- cookie & session
- Cookie & Session
- Session, Cookie
- Session、Cookie
- SESSION && COOKIE
- Cookie & Session
- SESSION && COOKIE
- Session.Cookie
- cookie session
- session cookie
- session cookie
- Cookie&Session
- cookie session
- Cookie&Session
- Cookie、Session
- cookie&session
- Cookie & Session
- Flash视频的编码格式
- 《#诗盗#·白衣沽酒醉花颜》
- oracle数据库导入导出命令!
- oracle connect by函数的简单应用
- 《#诗盗#·世界末日》
- cookie session
- 悬挂指针
- 《#诗盗#·碉堡的机机》
- android intent和intent action大全
- java进度条
- thrift多线程服务端
- xp下修改hosts不起作用
- 忆往昔,总是让人潸然泪下
- Image转换成Mysql的blob类型