可以让“session”在关闭浏览器后不被删除吗
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.7k
- Forks
- 253
- PR merge metrics
- No merged PRs in 30d
Description
在写用户登录后保持登录的功能,之前用的是
App::$base->session->web_userid =$webUser['uid']
来储存登录的用户信息,
但这个在每次关闭浏览器后重新打开,值就没了,
有想过用cookie来写,但cookie有安全隐患,
有什么办法让session可以不被自动清空吗?
看到 /config/config.php 里面有个
'session' => array(
'save_handler'=>'files', //redis memcache
'maxlifetime' => 60 * 60 * 24 * 7 //过期时间s
),
我在想 ,是不是与save_handler的值有关系
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with config/config.php and inspect the session settings, especially save_handler and maxlifetime. Reproduce the login session behavior across a browser restart, then review the existing comment discussion to determine whether the requested persistence is supported and what security constraints apply. Done means a clear, tested decision or documented behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authentication
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100