⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 session.java

📁 Auctions are among the oldest economic institutions in place. They have been used since antiquity to
💻 JAVA
字号:
import java.util.Random;
import java.net.*;

public class Session {
    private String theuser;
    private int id;
    private long expires;

    public Session (String theuser) {
       this.theuser = URLEncoder.encode (theuser);
       id = Math.abs(new Random (System.currentTimeMillis()).nextInt());
       expires = 0;
    }

    synchronized public void setExpires (long e) {
       expires = e;
    }

    public long getExpires() {
       return expires;
    }

    public String key() {
       return String.valueOf (id);
    }

    public String getEncodedUser() {
       return theuser;
    }

    public String getUser() {
       try {
          return URLDecoder.decode (theuser);
       }catch (Exception e) {
          return null;
       }
    }

    public int getId() {
       return id;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -