Session in Different File PHP
- How to stop session hijacking? User will not be saving too much sensitive data in the site, but still i want to ma开发者_StackOverflow社区ke it secure. I dont want to store any extra data in the MySQL.
- Can I save session data in 2 different file in the server and later check if they are same? For each user 2 same data will be stored in 2 session different file.
First, look at storing your sessions in a database http://www.devshed.com/c/a/PHP/Storing-PHP-Sessions-in-a-Database/
I don't know what you mean by storing extra data in the database, because sessions don't roll over browser restarts, you would need to keep any needed information in the database.
Second, I'm not sure, because you can write your own functions in php for session saving (look at above link) I suppose you could, but I don't understand why you would. Maybe data redundancy, you could save them to two different databases. But session data is considered volatile (doesn't save over restarts) so data stored there shouldn't be too important to need that type of redundancy.
精彩评论