Where should I store user's(not logged in) request data? - spring-boot

I want to make an alert function in my side project where users set their custom limit(especially for cryptocurrency prices), and whenever price move beyond their custom limit, users get alert from my server.(It's almost like tradingview's alert function).
I managed to get price data by using websocket. What I'm concerned about is that where should I store user's custom limit data?
I want this feature to open everybody, not just logged-in user, so I think It would be very difficult to store all custom limit data in Database. OR should I use session to store data?? I'm making this project all by my self and got no one to ask.. could anyone give me any tips/ or references? Thank you in advance.

i think you can store user's data on localStorage without login. This is a reference article on W3School : link here

Related

Extracting data from cakephp 3 sessions table

I am using Database Sessions in my CakePHP 3 application as I wish to display list online employees(users) in the admin panel of the site.
I want to retrieve the logged in employee(user)s' session info (at least user id) so that their details can be displayed in the list.
data column of the sessions table contains session info but I don't know how to extract specific info from it. I want Auth info from it. It contains serialized data concatenated with session key somehow.
Data Sample
Config|a:1:{s:4:"time";i:1457067440;}Flash|a:1:{s:4:"auth";a:1:{i:0;a:4:{s:7:"message";s:52:"Woopsie,
you are not authorized to access that
area.";s:3:"key";s:4:"auth";s:7:"element";s:13:"Flash/default";s:6:"params";a:1:{s:5:"class";s:5:"error";}}}}registrar_id|i:2;registrar_name|s:10:"Gaurav
Makhecha";unread_site_updates_ids|s:1:"1";
Can anyone please guide me on how I can achieve this the best way.
I don't know if the session db is the best place to implement that feature. Maybe you could use something else...
Just thinking out loud, maybe a logged in user could, at every request, renew some kind of flag. That could be done as well every X minutes with JS. That way, you filter out "old" flags and display fresh ones, which should display active users in the moment.
There are probably better ways to do that, but I think that using the session db wouldn't be the best way.

How do I access authorized user properties in the WebSphere application Lawson?

I'm assisting another developer with adding a link to a page in a product called Lawson that we use in-house. I need to pass the authenticated user's employee ID to an HTML page we're bolting on. I'm still looking at existing pages on the server, but thought I'd ask: does anyone know how the Javascript object that represents the authenticated user works? It looks like something server-side must be dynamically creating a Javascript object that has useful properties. It is usually called 'AuthUser'. I want to add the necessary JS references to my new page to support this object and access its properties. Does anyone have any experience with that? Thanks!
If you are in a portal session, you can access this in javascript through attributes of portalWnd.oUserProfile:
alert(portalWnd.oUserProfile.getAttribute("id"))
This will give you the logged in user's short username. Many other attributes are available. To see a complete list, log into a portal session and then replace the URL with:
http://YOURPORTALSERVER/servlet/Profile
I'm not sure what you mean by "bolting on", but if you want to pass an attribute to an external page launched from a Portal session, you could create a user shortcut via Portal preferences using something like:
javascript:window.open("http://yourserver/yourpage.html?user=" + portalWnd.oUserProfile.getAttribute("id"))
as the target and process in yourpage.html like a normal GET method form.
If you are still puzzling over this all these months later, provide some specifics if you need more guidance.

Persistent Data while Logged In

I am newbie developer in mac development. What I need to do is create an authentication dialog when the user clicks the Print button in any application.
I need to store the username and password for 1 hour (to avoid authentication all the time) but this should be deleted when the user logs out from the machine.
What I am thinking is to use NSUserDefaults to store the data, and create a logout hook to delete this data. Is this the proper way of doing this?
Use Authorization Services. It sounds like your app fits the "Simple, Self-Restricted Application" model described in the guide.
When you create your authorization right, use the timeout attribute to set the length of time that the user's credentials will be cached.

What is the Preferred Method to having multiple websites share checkout sessions

I have implemented many multi site implementations in the past, so I get how to set up the environment. What I haven't done, is set up multiple websites that can share the same cart session.
So if you are on site1.com and add something to your cart or are logged on, when you go to site2.com you are logged in and have the same items in your cart.
From what I read around the forums, well there isn't much about the best way to share session. But I do know that using the configuration to enable SID on the frontend will pass the session id if you transfer between sites. I figured this is all you need to have, but I see where people are saying that only stores can share checkout sessions and that stores can have their own domain.
I am thinking the best way to do this is to setup multiple websites not one website multiple stores and then just make sure when linking to the other site, I use proper magento url methods to build out the link and it will pass over the SID and the users session will be transferred over.
Is this the preferred way to do this? Is there anything I need to know in terms of configuration? Is there any negatives doing it this? Is there a better way?,
Well if you want to have such possibility only for logged customers then i propose to you to use sales_flat_quote table which is represented by Mage::getModel('sales/quote').
With this model you can manage cart and focus only in passing customer identifier which would bring us to security subject... How would you pass customer identifier in secure way as SID isn't very secure.
Plus SEO doesn't like SID in URL from what i've heard.

Updating App with Web Information

Hey everyone, I am sorry if this question has already been asked/answered
But I have a Cocoa program that has different arrays of models. Each model hold just Strings and one Image. Archiving and Loading works great.
Each model represents a web account, that is, it holds the username and password, and some other information related to the website. Moving forward I would like to be able to update information in each model by accessing the information from the website. For example updating a balance ($). I am wondering if there is a way to do that programatically that is:
Automatically log into web account using the entered username, pass, and website url
Update the balance based on the information following log in.
Thanks for the help in advance!
Tamara
There is no single approach to log into any arbitrary website. You will need to know what the API for the given website is. If the website provides a web service to query things like balance, then you would connect using that web service (REST-based if at all possible; SOAP is more of a pain in Cocoa), and update your model based on the results. If the website provides no web service, then you would have to scrape through the HTML responses looking for what you want, and this is generally very complex and fragile. There is no general answer to this question; you'd have to know what form the website is in.
On another note, make sure that you are not storing user passwords in unencrypted files. User passwords on Mac should always be stored in Keychain. There are many posts on SO about how to best use Keychain.
Rob, isn't it possible to just look through the login page's html source and see what are the names of the fields for user and pass, and then just send a POST request to that page from code ?

Resources