Best way of logging a user in C++

PrivateMufasa

I am trying to get into C++ programming so apologise if this is a bit of a stupid question.

I am attempting to create a program in C++ that is linked to a website via the database, that's all sorted. In this program, the user must log into it to be able to use its features, I've also managed to do this fine. My question is, what is the best way of storing that users session so I can refer to their username, display that users settings from the database e.c.t?

I am unsure, but I don't think c++ has session options like in php so I cannot do it that way. I did some googling before I posted this, spent all night trying to find a solution, I found nothing.

My knowledge if c++ is slim and this may sound like a more complicated or unnecessary route to take, but it was thinking of perhaps when the user logs in, to create a txt file storing that users username and then calling on it when I need to refer to that users username for queries and such, then when the user logs out or closes the program it deletes the file. Is that stupid? Forgive me if it is.

Is there better way to go about this?

Thanks for your time!

ArthurChamz

EDIT

I read your comments, if it needs to be a stand-alone application, like some sort of client, you could take a look at the C++ libraries I mentioned, but I'd use any higher level language (Java or C# have good documentation and there are many tutorials for creating GUIs, if that's what your're looking for. I think even Python would make a good candidate).

If you really must use C++, your best bet would be to use an existing library to implement your web solution. POCO includes an HTTP server framework, and a library for sockets and other forms of low-level network programming. Boost ASIO can also serve your purposes. But this is hardly something I'd recommend to start learning programming, or C++ for that matter.

If you want to learn about web programming, then you should definitely take a look at other languages. PHP or ASP.NET come to mind. AS you learn, you'll most likely also end up writing some form of Javascript. You can find a lot of info out there, just Google for tutorials. A site to get started is w3Schools, but any site with tutorials will do. Good luck!

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Best way to aggregate logging data

From Dev

Best way to authenticate user

From Dev

Best way to alert user

From Dev

Best way format user input before storing it (C)?

From Dev

Best way to store user settings

From Dev

What is the best way to add logging for creation of a Django Model instance?

From Dev

Best way to handle file operation for Logging last 1000 Events

From Dev

What is the best way to obtain the complete list of permission of a given user using AMO in C#

From Dev

What is the best way to convert all date time fields in c# to the time zone of the logged in user?

From Dev

Best way to let user to configure Vim plugin

From Dev

Best way add NOPASSWD vagrant user?

From Dev

What is the best way to implement user account activation?

From Dev

Best Way To Access User Permissions From View

From Dev

Best way to determine if a user went offline in MySQL

From Dev

Best way to get user's IP?

From Dev

What is the best way to store a user feature?

From Dev

Best way to store user's avatars

From Dev

Best way to accept permanent input from a user?

From Dev

Best way to determine user's language

From Dev

Best way to display something based on if user logged in or not

From Dev

Best way to reference the User model in Django >= 1.5

From Dev

What is the best way to safely read user input?

From Dev

Best way for user controls to communicate within the form

From Dev

Best way to uniquely identify a user in this case?

From Dev

Best way to present multiple confirmation messages to user

From Dev

What is the best way to store user notifications in MySQL?

From Dev

symfony : best way to set a user with a relationship

From Dev

Best way to integrate user defined function

From Dev

What is the best way to add a user to the sudoer group?

Related Related

  1. 1

    Best way to aggregate logging data

  2. 2

    Best way to authenticate user

  3. 3

    Best way to alert user

  4. 4

    Best way format user input before storing it (C)?

  5. 5

    Best way to store user settings

  6. 6

    What is the best way to add logging for creation of a Django Model instance?

  7. 7

    Best way to handle file operation for Logging last 1000 Events

  8. 8

    What is the best way to obtain the complete list of permission of a given user using AMO in C#

  9. 9

    What is the best way to convert all date time fields in c# to the time zone of the logged in user?

  10. 10

    Best way to let user to configure Vim plugin

  11. 11

    Best way add NOPASSWD vagrant user?

  12. 12

    What is the best way to implement user account activation?

  13. 13

    Best Way To Access User Permissions From View

  14. 14

    Best way to determine if a user went offline in MySQL

  15. 15

    Best way to get user's IP?

  16. 16

    What is the best way to store a user feature?

  17. 17

    Best way to store user's avatars

  18. 18

    Best way to accept permanent input from a user?

  19. 19

    Best way to determine user's language

  20. 20

    Best way to display something based on if user logged in or not

  21. 21

    Best way to reference the User model in Django >= 1.5

  22. 22

    What is the best way to safely read user input?

  23. 23

    Best way for user controls to communicate within the form

  24. 24

    Best way to uniquely identify a user in this case?

  25. 25

    Best way to present multiple confirmation messages to user

  26. 26

    What is the best way to store user notifications in MySQL?

  27. 27

    symfony : best way to set a user with a relationship

  28. 28

    Best way to integrate user defined function

  29. 29

    What is the best way to add a user to the sudoer group?

HotTag

Archive