Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session data 1

Status
Not open for further replies.

petey

Programmer
Mar 25, 2001
383
0
0
US
PHP serializes $_SESSION data between requests. What I want to know is whether this data can be acted on in any other way than through a page request.

The example scenario I have in mind is when a user lets his session time out, is there a way to auto-generate an email to him containing the data in his session?

petey
 
Yes.

You can replace PHP's default session-handling mechanisms with user-written functions. You could provide PHP with a custom garbage-collection function, the functionality of which would include emailing the user the data.

See session_set_save_handler()

and

faq434-2037

to see how to do this.

Just keep in mind that the data you're emailing is not as secure as keeping it on the server.

Also, exactly when PHP's garbage-collection mechanism will start cleaning up what when will vary by php.ini settings. See faq434-4908


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top