Have session send and receive data after browser is closed. .NET [closed] - c#

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
Is there a way to have a session send and receive data in intervals even after the user has closed their browser? We have members that signup and sometimes not receive a confirmation code due to a lost request to retrieve that code from our server that generates it.
My thought is to have the session try to retrieve that code for up to 4 hours in 30 minute intervals. If not, it will send an email to the member letting them know they need to signup again.
Is this possible with sessions? We are using .NET

Due to the nature of the web being disconnected you web pages/views should should show data and post data back back on user interaction where the the most immediate functions do what they need to do quickly. For instance if a user signs up to your service they are presented with a signup page, when the commit that page their details should be saved any further actions should not be done on that page and any operation needs to assume that browser could close at any time. If a user submits the signup form you should save their details.. anything else like email notifications etc should happen after that. To enable this simply, you could use something like HangFire (https://www.hangfire.io) to monitor signups and send emails using a background process.. (you could trigger this at the time as part of your signup method or have a recurring task to check signups) the key point being that the long running task like constructing and sending an email will be done outside the page request.

Related

asp.net c# website form actions after 24 hrs [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have an asp.net c# website which members complete a form which is stored in sql server. After 24 hrs, I would like to send a notification to a specific group of users if the form status has NOT changed. Is this achievable from within asp.net?? Any help is appreciated
I have done it several times and there are many ways to do it. One simple way is to check every X minutes if you need to send any notifications. If so, you send them.
For example: every 60 minutes you check if there are any forms that have been on the same status for 24hs. If so, you send a notification.
If you have full control of the server, I would recommend you to create a Windows Service to perform this job. ASP.NET was not built for long running tasks so that's why I'm suggesting to create a Windows Service.
One more thing, create a log table for this task so every time you send a notification, you add a row on that table. That's gonna help you debug any issues you might have. Also, remember to mark the rows where you have already notified the customer to avoid sending a notification twice. I always like to add a double check before sending the notification.

How to log out from a windows phone app? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am developping a Windows Phone 8 application in C#/Xaml.
When the user launched the app, he arrives on a log page and then he enters in the "real" app. My problem is: how can the user log out?
I tried to just come back on the log page by clicking on a button but then i have trouble with the back button.
Is there a way to kill the app manually?
What are the best practices to do that?
Thanks for your help!
I would try this :
A logout button wherever you want it that redirects to a xaml page stating "do you really want to logout ?" (let's call this page Logout.xaml) and in this page, you manage to redirect the user to the homepage of your app in the "Button_Click" method of your "yes" button, in the file Logout.xaml.cs.
Then, you override the OnNavigatingFrom method of the Lougout.xaml.cs file, and in this method you kill the user session.
This way, your user wants to disconnect, clicks yes, and goes back to the homepage with his session closed.
Now, if you already wanted to do that and your question is "how to kill the session ?", it depends on how you handle your user sessions
To Terminate the application you can use :
App.Current.Terminate();
There won't be any issue when using this call, but make sure you have saved all data in your app when calling this, because this call effectively kills your app immediately - ApplicationClosing even handler won't be raised after it!

Optimized way to get the updated results from the server [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a website which have more than 1000 users. I want to update the content of my site in every 10 sec.
Suppose if one user update anything in a table so it will reflect to other logged in user. But remember the user is ideal.
He doesn't press refresh on his browser.
I think of applying auto-refresh in every 10 sec through jquery which call the ajax post and gets back the
updated result. But with my approach if 1000 users are online so my server will be hit by 1000 times. I want some optimized way to do this. Any suggestions
Setup ajax push instead:
have the browser invoke a remote function on load.
Then on the server wait for an event (new information to send out) then return it to the browsers. This may be easiest with node.js.
You will have to handle connections dropping depending on the reliability you want to implement.
Here's a discussion of Ajax push with php:
Ajax push system

How do I setup user security in ASP.net? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have added functionality to my web app to allow someone to create an account with a password, which is then hashed and stored.
I would like to be able to allow the user to login to my site and use the pages within that check the user has access. Then after a period of time the session will expire and the user has to log in again.
It would also be good to have a logout button.
I am just wondering what is the best way to setup this kind of security as I have not done it before like this.
That wheel that you are making is nice for sure, but why not use one that has been invented already?
http://support.microsoft.com/kb/301240
As for sessions, you can use Session["NameOfSession"] to create a variable, don't forget to use Session.Abandon() though when a user logs out.
http://msdn.microsoft.com/en-us/library/ms178581.ASPX
As HTTP is offline protocol then there should be some extra-data being sent between client and server that makes server know you are logged on every request. The thing like this is cookie file that holds this information. On every request server checks this data and decides if you've already logged or not. Once you find the user's name and pass are OK you create this file, set its lifetime and attach to server response. After this the client browser will automatically send it to your server with each request. Once file is expired it will be automatically deleted by client browser.
You can maintain this functionality by hands or trust to FormsAuthentication.

Retrieve the user requests from a website using a desktop application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I had made a site for client in which users can make request for songs, there's a database having songname, by whom, written by, sang at etc. The site is hosted and working fine.
The way the admin gets to know what is asked for is by using the website but now he wants that there be a desktop application which displays all the requests so he does not have to log in and use the website
I do have an idea to get this done, but I am hoping for a well known established way. I am using C# asp.net.
I think you can create an Http Handler. This handler will listen to the request and you can log them in a database, and the windows application will read from the database.
You can simply use Timer in windows application.
Set your Timer to either 1 min or 2 min as per your need.and on its Tick event you check the live database whether is there any new request come or not..
If new request come then you can show some notification or something like this...

Categories