asp.net - Saving Information For The Duration The User Has A Site open -
How do I set it up:
Which link does I add to a user in a website? I want to save it. I had thought of creating a jquery function that would save the link name from clicking on a link every time, then after user shutting down the site, the information Ajax to DB
Is this sound proper in any of the samples?
Since there are many pages with multilayer links, I want to integrate something in javascript for a session variable so that I add a link to a user at all times and send DB information only once, every time A user opens a DB connection and sends information when clicking on a link.
There are links products so I want to save related products, so I want to save related product information. Maybe I need a cookie instead?
Waiting for the user to leave the site is good in theory, but never practice. Because you can not really know for sure when the user is going - or it may be late (such as the user has turned the computer off.) That you actually want to do, Keeps track of using AJAX
To do this, you must specify a unique ID for each user session. ASP.N.T It does this for you (a session cookie is created for each visitor on the site.) Using the ASP.NET session identifier will save you a lot of work.
Every time the user you want to save, just have to make an AJAX call (you do not care about return) which logs in to your DB.
Here's a Microsoft Doc about Automatic Session ID
or to get unique IDs, use only the following code:
string sessID = System.Web.SessionState.SessionID;
Comments
Post a Comment