awacke1 commited on
Commit
fc1a892
Β·
verified Β·
1 Parent(s): 1337da7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -0
app.py CHANGED
@@ -1,6 +1,32 @@
1
  import streamlit as st
2
  from streamlit.components.v1 import html
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  # Debugging Headers and Cookies
5
  st.write("Headers:", st.context.headers)
6
  st.write("Cookies:", st.context.cookies)
 
1
  import streamlit as st
2
  from streamlit.components.v1 import html
3
 
4
+
5
+
6
+ from streamlit_cookies_controller import CookieController
7
+
8
+ st.set_page_config('Cookie QuickStart', 'πŸͺ', layout='wide')
9
+
10
+ controller = CookieController()
11
+
12
+ # Set a cookie
13
+ controller.set('cookie_name', 'testing')
14
+
15
+ # Get all cookies
16
+ cookies = controller.getAll()
17
+
18
+ # Get a cookie
19
+ cookie = controller.get('cookie_name')
20
+
21
+ # Remove a cookie
22
+ controller.remove('cookie_name')
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
  # Debugging Headers and Cookies
31
  st.write("Headers:", st.context.headers)
32
  st.write("Cookies:", st.context.cookies)